2012-02-11 147 views
3

我用杜松子酒1.5和2.4 GWT之前我加杜松子酒建就好了項目編制,但現在不會:麻煩與杜松子酒

[ERROR] [foo] - Generator 'com.google.gwt.inject.rebind.GinjectorGenerator' threw an exception while rebinding 'com.foo.html.client.FooGinjector' 

的錯誤是:

20:58:04.252 [ERROR] [foo] Generator 'com.google.gwt.inject.rebind.GinjectorGenerator' threw an exception while rebinding 'com.foo.html.client.FooGinjector' 
com.google.inject.internal.ComputationException: java.lang.NoClassDefFoundError: com/google/inject/assistedinject/Assisted 
    at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:553) 
    at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419) 
    at com.google.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041) 
    at com.google.inject.internal.FailableCache.get(FailableCache.java:46) 
    at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:48) 
    at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:121) 
    at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:443) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:698) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:630) 
    at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:223) 
    at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:174) 
    at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:704) 
    at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:45) 
    at com.google.inject.internal.BindingProcessor.runCreationListeners(BindingProcessor.java:238) 
    at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:143) 
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:116) 
    at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:101) 
    at com.google.inject.Guice.createInjector(Guice.java:105) 
    at com.google.inject.Guice.createInjector(Guice.java:90) 
    at com.google.gwt.inject.rebind.GinjectorGenerator.generate(GinjectorGenerator.java:47) 
    at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48) 
    at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60) 
    at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:647) 
    at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41) 
    at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78) 
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:268) 
    at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141) 
    at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:585) 
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455) 
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49) 
    at com.google.gwt.core.client.GWT.create(GWT.java:97) 
    at com.foo.html.client.FooGameHtml.<init>(FooGameHtml.java:39) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 
    at java.lang.reflect.Constructor.newInstance(Unknown Source) 
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:465) 
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:375) 
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) 
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525) 
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) 
    at java.lang.Thread.run(Unknown Source) 
Caused by: java.lang.NoClassDefFoundError: com/google/inject/assistedinject/Assisted 
    at java.lang.Class.getDeclaredConstructors0(Native Method) 
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) 
    at java.lang.Class.getDeclaredConstructors(Unknown Source) 
    at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:232) 
    at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:92) 
    at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:489) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:696) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:630) 
    at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:223) 
    at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:174) 
    at com.google.inject.internal.InjectorImpl.createProviderBinding(InjectorImpl.java:281) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:662) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:630) 
    at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:223) 
    at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:174) 
    at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:704) 
    at com.google.inject.internal.InjectorImpl.createParameterInjector(InjectorImpl.java:772) 
    at com.google.inject.internal.InjectorImpl.getParametersInjectors(InjectorImpl.java:760) 
    at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:55) 
    at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:27) 
    at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35) 
    at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33) 
    at com.google.inject.internal.FailableCache$1.apply(FailableCache.java:35) 
    at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549) 
    at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419) 
    at com.google.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041) 
    at com.google.inject.internal.FailableCache.get(FailableCache.java:46) 
    at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:48) 
    at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:121) 
    at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:443) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:698) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:630) 
    at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:223) 
    at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:174) 
    at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:704) 
    at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:45) 
    at com.google.inject.internal.BindingProcessor.runCreationListeners(BindingProcessor.java:238) 
    at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:143) 
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:116) 
    at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:101) 
    at com.google.inject.Guice.createInjector(Guice.java:105) 
    at com.google.inject.Guice.createInjector(Guice.java:90) 
    at com.google.gwt.inject.rebind.GinjectorGenerator.generate(GinjectorGenerator.java:47) 
    at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48) 
    at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60) 
    at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:647) 
    at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41) 
    at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78) 
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:268) 
    at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141) 
    at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:585) 
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455) 
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49) 
    at com.google.gwt.core.client.GWT.create(GWT.java:97) 
    at com.foo.html.client.FooGameHtml.<init>(FooGameHtml.java:39) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 
    at java.lang.reflect.Constructor.newInstance(Unknown Source) 
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:465) 
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:375) 
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) 
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525) 
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) 
    at java.lang.Thread.run(Unknown Source) 
Caused by: java.lang.ClassNotFoundException: com.google.inject.assistedinject.Assisted 
    at java.net.URLClassLoader$1.run(Unknown Source) 
    at java.net.URLClassLoader$1.run(Unknown Source) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.net.URLClassLoader.findClass(Unknown Source) 
    at java.lang.ClassLoader.loadClass(Unknown Source) 
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) 
    at java.lang.ClassLoader.loadClass(Unknown Source) 
    at java.lang.Class.getDeclaredConstructors0(Native Method) 
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) 
    at java.lang.Class.getDeclaredConstructors(Unknown Source) 
    at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:232) 
    at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:92) 
    at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:489) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:696) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:630) 
    at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:223) 
    at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:174) 
    at com.google.inject.internal.InjectorImpl.createProviderBinding(InjectorImpl.java:281) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:662) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:630) 
    at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:223) 
    at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:174) 
    at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:704) 
    at com.google.inject.internal.InjectorImpl.createParameterInjector(InjectorImpl.java:772) 
    at com.google.inject.internal.InjectorImpl.getParametersInjectors(InjectorImpl.java:760) 
    at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:55) 
    at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:27) 
    at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:35) 
    at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33) 
    at com.google.inject.internal.FailableCache$1.apply(FailableCache.java:35) 
    at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:549) 
    at com.google.inject.internal.MapMaker$StrategyImpl.compute(MapMaker.java:419) 
    at com.google.inject.internal.CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041) 
    at com.google.inject.internal.FailableCache.get(FailableCache.java:46) 
    at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:48) 
    at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:121) 
    at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:443) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:698) 
    at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:630) 
    at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:223) 
    at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:174) 
    at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:704) 
    at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:45) 
    at com.google.inject.internal.BindingProcessor.runCreationListeners(BindingProcessor.java:238) 
    at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:143) 
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:116) 
    at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:101) 
    at com.google.inject.Guice.createInjector(Guice.java:105) 
    at com.google.inject.Guice.createInjector(Guice.java:90) 
    at com.google.gwt.inject.rebind.GinjectorGenerator.generate(GinjectorGenerator.java:47) 
    at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48) 
    at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60) 
    at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:647) 
    at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41) 
    at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:78) 
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:268) 
    at com.google.gwt.dev.shell.ShellModuleSpaceHost.rebind(ShellModuleSpaceHost.java:141) 
    at com.google.gwt.dev.shell.ModuleSpace.rebind(ModuleSpace.java:585) 
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:455) 
    at com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49) 
    at com.google.gwt.core.client.GWT.create(GWT.java:97) 
    at com.foo.html.client.FooGameHtml.<init>(FooGameHtml.java:39) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 
    at java.lang.reflect.Constructor.newInstance(Unknown Source) 
    at com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:465) 
    at com.google.gwt.dev.shell.ModuleSpace.onLoad(ModuleSpace.java:375) 
    at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:200) 
    at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:525) 
    at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363) 
    at java.lang.Thread.run(Unknown Source) 

我在做什麼錯?我的類路徑上有guice-assistedinject-snapshot.jarguice-snapshot.jar,依次排列。

導致錯誤在我的入口點類線爲:

private final FooGinjector injector = GWT.create(FooGinjector.class); 

FooGinjector.java:

@GinModules(FooGinModule.class) 
public interface FooGinjector extends Ginjector { 

    EventBus eventBus(); 

    PlaceHistoryHandler historyHandler(); 

} 
+0

你可以顯示你的模塊配置('FooGinModule')嗎?您所展示的任何內容都不顯示任何輔助注射的使用。 – 2012-02-13 18:48:40

回答

2

我感動assistedinject罐子高於在其他杜松子酒瓶classpath,現在看起來工作正常。

0

當我第一次看到這個我想到了明顯的模塊繼承的缺失在gwt.xml

<!-- Other module inherits          --> 
    <inherits name="com.google.gwt.inject.Inject"/> 

既然你回答了你自己的問題,我想我會在添加一些別的,我發現轉換時轉到GIN。

根據我在網上找到的部分教程,我將HelloMVP應用轉換爲GIN。 我發現的是在活動中添加&如果您不熟悉guice語法,那麼位置會變得更加複雜。

如果你去和嘗試運行與地方你的代碼,你需要知道你的GINModule配置方法正確綁定語法:

bind(SimplePanel.class).in(Singleton.class); 
bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class); 
//Notice that the interface must be declared first, then the implementation on the binding. 
bind(PlaceHistoryMapper.class).to(AppPlaceHistoryMapper.class).in(Singleton.class); 
bind(ActivityMapper.class).to(AppActivityMapper.class).in(Singleton.class); 
etc... 

這一次把我一會兒,我不知道如何在這裏宣佈單身人士。我不知道你是否通過了這個問題。