ekuefler / gwt-supereventbus

High-octane event bus for GWT
https://ekuefler.github.io/gwt-supereventbus
Apache License 2.0
39 stars 2 forks source link

Sources don't compile, did I forget to inherit a required module? #1

Closed arnor2000 closed 11 years ago

arnor2000 commented 11 years ago

I wanted to try this super EventBus which looks really great but I came across a compilation error at the very beginning.

I simply inherited from com.ekuefler.supereventbus.SuperEventBus and followed the guide to post an event between two classes, nice to use!

The problem is event is never send, obviously because EventRegistrationGenerator and EventRegistrationWriter don't compile. Compiler seems to complain about almost every classes they use.

Did I forget to inherit a module?

I'm using eclipse with GPE, GWT 2.5.1 and GAE 1.8.1.1.

Compiling...
      Compilation completed in 0,00 seconds
   Added 2719 units to cache since last cleanup.
   Validating units:
      Errors in 'com/ekuefler/supereventbus/rebind/EventRegistrationGenerator.java'
         Line 40: No source code is available for type com.google.gwt.core.ext.Generator; did you forget to inherit a required module?
         Line 43: No source code is available for type com.google.gwt.core.ext.TreeLogger; did you forget to inherit a required module?
         Line 43: No source code is available for type com.google.gwt.core.ext.GeneratorContext; did you forget to inherit a required module?
         Line 44: No source code is available for type com.google.gwt.core.ext.UnableToCompleteException; did you forget to inherit a required module?
         Line 46: No source code is available for type com.google.gwt.core.ext.typeinfo.JClassType; did you forget to inherit a required module?
         Line 48: No source code is available for type com.google.gwt.user.rebind.SourceWriter; did you forget to inherit a required module?
         Line 58: No source code is available for type com.google.gwt.core.ext.typeinfo.NotFoundException; did you forget to inherit a required module?
         Line 59: No source code is available for type com.google.gwt.core.ext.TreeLogger.Type; did you forget to inherit a required module?
         Line 64: No source code is available for type com.google.gwt.core.ext.typeinfo.TypeOracle; did you forget to inherit a required module?
         Line 73: No source code is available for type com.google.gwt.user.rebind.ClassSourceFileComposerFactory; did you forget to inherit a required module?
         Line 77: The method getCanonicalName() is undefined for the type Class<EventHandlerMethod>
         Line 78: The method getCanonicalName() is undefined for the type Class<LinkedList>
         Line 79: The method getCanonicalName() is undefined for the type Class<List>
         Line 80: The method getCanonicalName() is undefined for the type Class<MultiEvent>
         Line 82: No source code is available for type java.io.PrintWriter; did you forget to inherit a required module?
      Errors in 'com/ekuefler/supereventbus/rebind/EventRegistrationWriter.java'
         Line 44: No source code is available for type com.google.gwt.core.ext.TreeLogger; did you forget to inherit a required module?
         Line 53: No source code is available for type com.google.gwt.core.ext.typeinfo.JClassType; did you forget to inherit a required module?
         Line 53: No source code is available for type com.google.gwt.user.rebind.SourceWriter; did you forget to inherit a required module?
         Line 53: No source code is available for type com.google.gwt.core.ext.UnableToCompleteException; did you forget to inherit a required module?
         Line 60: The method format(String, String) is undefined for the type String
         Line 63: No source code is available for type com.google.gwt.core.ext.typeinfo.JMethod; did you forget to inherit a required module?
         Line 74: The method getCanonicalName() is undefined for the type Class<MultiEvent>
         Line 77: The method getCanonicalName() is undefined for the type Class<capture#1-of ?>
         Line 91: The method format(String, String) is undefined for the type String
         Line 127: No source code is available for type com.google.gwt.core.ext.TreeLogger.Type; did you forget to inherit a required module?
         Line 128: The method format(String, String, String) is undefined for the type String
         Line 133: The method format(String, String, String) is undefined for the type String
         Line 139: The method getCanonicalName() is undefined for the type Class<MultiEvent>
         Line 143: The method format(String, String, String) is undefined for the type String
         Line 152: The method isAssignableFrom(Class<capture#5-of ?>) is undefined for the type Class<capture#4-of ?>
         Line 155: The method getSimpleName() is undefined for the type Class<capture#6-of ?>
         Line 155: The method getSimpleName() is undefined for the type Class<capture#7-of ?>
         Line 164: The method format(String, String, String) is undefined for the type String
         Line 182: The method getSimpleName() is undefined for the type Class<capture#9-of ?>
         Line 190: The method getCanonicalName() is undefined for the type Class<capture#10-of ?>
         Line 198: No source code is available for type com.google.gwt.core.ext.typeinfo.JType; did you forget to inherit a required module?
         Line 200: No source code is available for type com.google.gwt.core.ext.typeinfo.JPrimitiveType; did you forget to inherit a required module?
         Line 225: No source code is available for type java.lang.reflect.Constructor<T>; did you forget to inherit a required module?
         Line 225: The method getConstructors() is undefined for the type Class<capture#11-of ?>
         Line 231: No source code is available for type java.lang.SecurityException; did you forget to inherit a required module?
   Removing invalidated units
ekuefler commented 11 years ago

I haven't really released or announced SuperEventBus yet, but thanks for taking an early look! Are you using Maven? Things seem to work fine for me using Maven, but if you're not you might have to add this line to your gwt.xml file:

<inherits name="com.ekuefler.supereventbus.SuperEventBus"/>

Could you try this and see if it works? If so I will update the instructions. Thanks!

arnor2000 commented 11 years ago

Yes I'm using Maven and added this dependency:

<dependency>
  <groupId>com.ekuefler.supereventbus</groupId>
  <artifactId>supereventbus</artifactId>
  <version>0.0.1</version>
</dependency>

I tried without scope and with provided scope. And I inherited from it in my gwt.xml:

<inherits name="com.ekuefler.supereventbus.SuperEventBus"/>

I agree it's as if I haven't inherited from the module at all.

This evening I'll try on a project from scratch, maybe it'll help to identify the problem.

arnor2000 commented 11 years ago

I thought about the compilation errors harder and it appears to me 'rebind' package shouldn't be included in GWT sources at first. I changed SuperEventBus.gwt.xml source line to <source path="" excludes="rebind/*"/> and it's now working perfectly!

Cheers

arnor2000 commented 11 years ago

I sent a pull request with the correction. I know you could do it yourself but it was a good occasion to try to commit, it's my first time on GitHub :)

omespino commented 9 years ago

@arnor2000 Hey men i love you in the good way, i was looking for a solution by almost 1 week and i resoveld the same problem with thank you very much bro