Re: GWT 2.5 dev mode refresh error

208 views
Skip to first unread message

Michal Moravcik

unread,
Jan 16, 2013, 9:25:55 PM1/16/13
to google-we...@googlegroups.com
I found a workaround solution.

When I manually reset the cached generator result in my ServiceInterfaceProxyGenerator the problem disappears.

public class RpcInterceptorServiceProxyGenerator extends ServiceInterfaceProxyGenerator {
@Override
public RebindResult generateIncrementally(TreeLogger logger, GeneratorContext ctx, String requestedClass) throws UnableToCompleteException {
((StandardGeneratorContext) ctx).setCachedGeneratorResult(null); // reset cached result here
super.generateIncrementally(logger, ctx, requestedClass);
// ... generate code ...
return new RebindResult(RebindMode.USE_ALL_NEW, newTypeName);
}
}

If anybody finds a better solution, please let me know. Thanks.

Michal Moravcik


Dňa utorok, 15. januára 2013 23:08:23 UTC+1 Michal Moravcik napísal(-a):
Lately I have upgraded GWT to version 2.5.0 and sice then I am experiencing a problem with Developer mode.

First time the GWT module is loaded as usually with no problem, but when I try to reload it (F5 in browser) without doing anything on page or changing any code I am getting following error:


00:00:22.768 [ERROR] Generator 'eu.geomodel.solargis.gwt.codegen.RpcInterceptorServiceProxyGenerator' threw an exception while rebinding 'eu.geomodel.solargis.common.rpc.CustomerService'

java.lang.NullPointerException: null 
at com.google.gwt.user.rebind.rpc.TypeSerializerCreator.findReusableCachedFieldSerializerIfAvailable(TypeSerializerCreator.java:328) 
at com.google.gwt.user.rebind.rpc.TypeSerializerCreator.createFieldSerializer(TypeSerializerCreator.java:260) 
at com.google.gwt.user.rebind.rpc.TypeSerializerCreator.createFieldSerializers(TypeSerializerCreator.java:288) 
at com.google.gwt.user.rebind.rpc.TypeSerializerCreator.realize(TypeSerializerCreator.java:189) 
at com.google.gwt.user.rebind.rpc.ProxyCreator.generateTypeHandlers(ProxyCreator.java:702) 
at com.google.gwt.user.rebind.rpc.ProxyCreator.create(ProxyCreator.java:352) 
at com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator.generateIncrementally(ServiceInterfaceProxyGenerator.java:67) 
at eu.geomodel.solargis.gwt.codegen.RpcInterceptorServiceProxyGenerator.generateIncrementally(RpcInterceptorServiceProxyGenerator.java:55) 
at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:651) 
at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41) 
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79) 
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276) 
at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141) 
at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:595) 
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:465) 
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49) 
at com.google.gwt.core.shared.GWT.create(GWT.java:57) 
at com.google.gwt.core.client.GWT.create(GWT.java:85) 
at eu.geomodel.solargis.common.rpc.eu_geomodel_solargis_gwt_account_gin_AccountGinjector_AccountGinjectorGinjector_fragment.get_Key$type$eu$geomodel$solargis$common$rpc$CustomerServiceAsync$_annotation$$none$$(eu_geomodel_solargis_gwt_account_gin_AccountGinjector_AccountGinjectorGinjector_fragment.java:83) 
at eu.geomodel.solargis.gwt.customer.eu_geomodel_solargis_gwt_account_gin_AccountGinjector_AccountGinjectorGinjector_fragment.get_Key$type$eu$geomodel$solargis$gwt$customer$CustomerPresenter$_annotation$$none$$(eu_geomodel_solargis_gwt_account_gin_AccountGinjector_AccountGinjectorGinjector_fragment.java:51) 
at eu.geomodel.solargis.gwt.customer.eu_geomodel_solargis_gwt_account_gin_AccountGinjector_AccountGinjectorGinjector_fragment.initializeEagerSingletons(eu_geomodel_solargis_gwt_account_gin_AccountGinjector_AccountGinjectorGinjector_fragment.java:125) 
at eu.geomodel.solargis.gwt.account.gin.eu_geomodel_solargis_gwt_account_gin_AccountGinjector_AccountGinjectorGinjector.initializeEagerSingletons(eu_geomodel_solargis_gwt_account_gin_AccountGinjector_AccountGinjectorGinjector.java:788) 
at eu.geomodel.solargis.gwt.account.gin.eu_geomodel_solargis_gwt_account_gin_AccountGinjectorImpl.<init>(eu_geomodel_solargis_gwt_account_gin_AccountGinjectorImpl.java:10) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) 
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:525) 
at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:475) 
at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49) 
at com.google.gwt.core.shared.GWT.create(GWT.java:57) 
at com.google.gwt.core.client.GWT.create(GWT.java:85) 
at eu.geomodel.solargis.gwt.account.gin.AccountGinjector$Holder.<clinit>(AccountGinjector.java:28) 
at eu.geomodel.solargis.gwt.account.AccountEntryPoint.onModuleLoad(AccountEntryPoint.java:25) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:601) 
at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:406) 
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) 
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526) 
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364) 
at java.lang.Thread.run(Thread.java:722)

The error can be seen in both Chrome and Firefox. Actually when I first load the GWT module in Chrome (with no problem) and then in Firefox I get the same error (and vice versa: firstly in FF then error in Chrome), so I think it is more-less browser independent.
Do you have any clue what might be the problem? Thank you for help

Regards,
Michal Moravcik

Thomas Broyer

unread,
Jan 17, 2013, 3:36:17 AM1/17/13
to google-we...@googlegroups.com
You can disable the generators' result caching by setting the gwt.disableGeneratorResultCaching system property.

It's strange though that you have this NPE to begin with. Could you try running DevMode with "-ea" (in the JVM options) and/or "-logLevel DEBUG" (in the program args) and see there's something interesting in the output?

Michal Moravcik

unread,
Jan 17, 2013, 7:04:02 AM1/17/13
to google-we...@googlegroups.com
Yes, the gwt.disableGeneratorResultCaching flag helped and I can remove my previous hack.

After adding debug options I don't see anything special in logs. Anyway I can try prepare sample project demostrating the problem.



Dňa štvrtok, 17. januára 2013 9:36:17 UTC+1 Thomas Broyer napísal(-a):
Reply all
Reply to author
Forward
0 new messages