New issue 119 by dusan.maliarik: NPE in
BindingsProcessor.createImplicitBinding
http://code.google.com/p/google-gin/issues/detail?id=119
Using both trunk and 1.0, I'm getting following exception which doesn't
provide much information on how to fix my bindings. This one is produced by
trunk version of gin:
14:59:13.680 [ERROR] [client]
Generator 'com.google.gwt.inject.rebind.GinjectorGenerator' threw threw an
exception while rebinding 'org.ires.gwt.client.gin.ClientGinjector'
java.lang.NullPointerException: null
at
com.google.gwt.inject.rebind.BindingsProcessor.createImplicitBinding(BindingsProcessor.java:491)
at
com.google.gwt.inject.rebind.BindingsProcessor.access$900(BindingsProcessor.java:98)
at
com.google.gwt.inject.rebind.BindingsProcessor$GuiceBindingVisitor.addImplicitBinding(BindingsProcessor.java:967)
at
com.google.gwt.inject.rebind.BindingsProcessor$GuiceBindingVisitor.visit(BindingsProcessor.java:957)
at
com.google.gwt.inject.rebind.BindingsProcessor$GuiceBindingVisitor.visit(BindingsProcessor.java:888)
at
com.google.inject.internal.UntargettedBindingImpl.acceptTargetVisitor(UntargettedBindingImpl.java:40)
at
com.google.gwt.inject.rebind.BindingsProcessor$GuiceElementVisitor.visit(BindingsProcessor.java:817)
at
com.google.gwt.inject.rebind.BindingsProcessor$GuiceElementVisitor.visit(BindingsProcessor.java:810)
at
com.google.inject.internal.BindingImpl.acceptVisitor(BindingImpl.java:92)
at
com.google.gwt.inject.rebind.BindingsProcessor.createBindingsForModules(BindingsProcessor.java:402)
at
com.google.gwt.inject.rebind.BindingsProcessor.process(BindingsProcessor.java:237)
at
com.google.gwt.inject.rebind.GinjectorGeneratorImpl.generate(GinjectorGeneratorImpl.java:76)
at
com.google.gwt.inject.rebind.GinjectorGenerator.generate(GinjectorGenerator.java:47)
at
com.google.gwt.dev.javac.StandardGeneratorContext.runGenerator(StandardGeneratorContext.java:418)
at
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:38)
at
com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.tryRebind(StandardRebindOracle.java:108)
at
com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:54)
at
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:154)
at
com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:119)
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:531)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:414)
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:39)
at com.google.gwt.core.client.GWT.create(GWT.java:98)
at org.ires.gwt.client.Client.<init>(Client.java:13)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:422)
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:361)
at
com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:185)
at
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:380)
at
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:619)
Comment #1 on issue 119 by aragos: NPE in
BindingsProcessor.createImplicitBinding
http://code.google.com/p/google-gin/issues/detail?id=119
Interesting, you're trying to bind a type which GWT can't seem to find. I
can provide you with a patched Gin version that will give a better error
message as to which type is affected.
Comment #2 on issue 119 by aragos: NPE in
BindingsProcessor.createImplicitBinding
http://code.google.com/p/google-gin/issues/detail?id=119
Marking as "won't fix" for now since we have too little information on how
this came about.
Ah. Dropped off my radar.
FYI, I see that we get this type of error when we mistakenly reference a
non-gwt class (well, one without a source file available for GWT). I'll
open a new bug if feeling properly motivated by additional errors.
I also get such errors a lot and I am pretty much left alone in space
tracking down the actual problem.
> I can provide you with a patched Gin version
> that will give a better error message as to which type is affected.
That would really save the world. However the provided link does not work
for me.
Hi again,
Class: com.google.gwt.inject.rebind.BindingsProcessor
Method: createImplicitBinding
Line 498 (or 491):
if (rawClassType.equals(ginjectorInterface)) {
For some reason the TypeOracle can return null for rawClassType and then
you get this NPE. An excellent improvement would be to add this before the
if stated above:
if (rawClassType == null) {
throw new IllegalStateException("Failed to resolve " + key);
}
I tracked my problem down to the root and in the end I used an
someClass.isAssignableFrom(otherClass)
what is not compliant with GWT client code.
I would expect the GWT Compiler to log something in such case. I got no
message for this problem even with -loglevel DEBUG.
Not a problem of GIN but if you have good connections to GWT core team
please let them know to improve... Thanks for all!