Closed GoogleCodeExporter closed 9 years ago
The stack trace here looks quite strange. It looks like a method cannot be
called because it doesn't exist, but from the source I'd say it's there:
http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/goo
gle/gwt/user/rebind/SourceWriter.java#53
It is possible that the custom class loader in Gin is causing this problem
(although unlikely) and I'll look into that possibility. But I cannot see
(right now) how this has anything with eager singletons in particular.
Original comment by aragos
on 22 Apr 2011 at 10:32
So, this exception was because I had mismatched GWT and Gin versions. Sorry.
I am seeing some sort of issue with real code, but this must not be it.
Original comment by dburr...@google.com
on 23 Apr 2011 at 12:19
So, this exception was because I had mismatched GWT and Gin versions.
Sorry.
I am seeing some sort of issue with real code, but apparently it's harder
to isolate than I thought. I'll close this issue and reopen it if I can
reproduce it for real.
Original comment by dburr...@google.com
on 23 Apr 2011 at 12:20
Ok, here's a working reproduction:
@GinModules({TestGinModule.class})
public interface Injector extends Ginjector {
}
public class TestGinModule extends PrivateGinModule {
@Override
protected void configure() {
bind(Implementation.class).asEagerSingleton();
bind(SubInterface.class).to(SubImplementation.class);
}
}
public class Implementation {
@Inject Implementation(SubInterface subInterface) {}
}
public Interface SubInterface {
}
public class SubImplementation implements SubInterface {
}
Please note that this is a minimal example. In particular, Implementation must
inject something -- if it has no dependencies, I don't see this bug.
The error I get is:
[java] [ERROR] Errors in '/home/dburrows/src/gin-test-cases/gen/com/google/dburrows/client/com_google_dburrows_client_GinTestInjectorImpl.java'
[java] [ERROR] Line 140: The method get_Key$type$com$google$dburrows$client$Implementation1$_annotation$$none$$() is undefined for the type com_google_dburrows_client_GinTestInjectorImpl
Inspection of the generated Ginjector reveals that the named method is present
in an inner class (corresponding to the private module). The obvious fix is to
output a constructor for the private Ginjector that includes its eager
singletons, and move them out of the root Ginjector.
Original comment by dburr...@google.com
on 23 Apr 2011 at 12:47
I created a fix for this problem, please review at
http://codereview.appspot.com/4431063
Original comment by aragos
on 25 Apr 2011 at 12:42
Fixed in r198.
Original comment by aragos
on 25 Apr 2011 at 8:09
Thanks! r198 fixes both my toy case and the real code where I ran into this
bug.
Original comment by dburr...@google.com
on 26 Apr 2011 at 8:28
Original issue reported on code.google.com by
dburr...@google.com
on 22 Apr 2011 at 9:06