2012-01-29 66 views
0

我試圖設置我的開發環境,並且遇到了很大的問題。 我設置它來運行gwt-gae-maven應用程序,它將使用guice進行依賴注入和requestfactory來保存數據。 我使用了一個API,我在這裏找到https://github.com/etiennep/injected-requestfactory ...這看起來很神奇但不適合我。 Tryed做喜歡這裏http://www.wanderingcanadian.ca/guiced-up-gwt-requestfactory並沒有什麼作品... 當我嘗試運行它作爲web應用我得到這個異常,並沒有什麼作品:在maven-gae-gwt項目中使用guice + requestfactory的情況

1)錯誤定製供應商,了java.lang.RuntimeException:

java.lang.reflect.InvocationTargetException 
    at com.kradcifer.glazier.server.requestfactory.InjectedRequestFactoryModule.getValidatorFactory(InjectedRequestFactoryModule.java:42) 
    while locating javax.validation.ValidatorFactory 
    at com.kradcifer.glazier.server.requestfactory.InjectedRequestFactoryModule.getValidator(InjectedRequestFactoryModule.java:59) 
    while locating javax.validation.Validator 
    for parameter 1 at com.kradcifer.glazier.server.requestfactory.InjectedServiceLayerDecorator.<init>(InjectedServiceLayerDecorator.java:36) 
    while locating com.kradcifer.glazier.server.requestfactory.InjectedServiceLayerDecorator 
    while locating com.google.web.bindery.requestfactory.server.ServiceLayerDecorator 
    for parameter 1 at com.kradcifer.glazier.server.requestfactory.InjectedRequestFactoryServlet.<init>(InjectedRequestFactoryServlet.java:25) 
    while locating com.kradcifer.glazier.server.requestfactory.InjectedRequestFactoryServlet 

1 error 
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:741) 
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:763) 
    at com.google.inject.servlet.ServletDefinition.init(ServletDefinition.java:74) 
    at com.google.inject.servlet.ManagedServletPipeline.init(ManagedServletPipeline.java:86) 
    at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:106) 
    at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:168) 
    at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97) 
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) 
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:593) 
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) 
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220) 
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513) 
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) 
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:468) 
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) 
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) 
    at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115) 
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) 
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) 
    at org.mortbay.jetty.Server.doStart(Server.java:222) 
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) 
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:672) 
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509) 
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068) 
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811) 
    at com.google.gwt.dev.DevMode.main(DevMode.java:311) 
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 
    at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:106) 
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:44) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:43) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:785) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) 
    at com.google.inject.Scopes$1$1.get(Scopes.java:54) 
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:44) 
    at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:732) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:785) 
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:728) 
    at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:89) 
    at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:95) 
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:44) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:43) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:785) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) 
    at com.google.inject.Scopes$1$1.get(Scopes.java:54) 
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:44) 
    at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) 
    at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) 
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:79) 
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:180) 
    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:51) 
    at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) 
    at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) 
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:79) 
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:180) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:43) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:785) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) 
    at com.google.inject.Scopes$1$1.get(Scopes.java:54) 
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:44) 
    at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:732) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:778) 
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:728) 
    ... 25 more 
Caused by: java.lang.reflect.InvocationTargetException 
    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.inject.internal.ProviderMethod.get(ProviderMethod.java:101) 
    ... 59 more 
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/validation/Validation 
    at java.lang.ClassLoader.defineClass1(Native Method) 
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791) 
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) 
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) 
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71) 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361) 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload$WebAppClassLoaderExtension.findClass(JettyLauncher.java:372) 
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:366) 
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337) 
    at com.kradcifer.glazier.server.requestfactory.InjectedRequestFactoryModule.getValidatorFactory(InjectedRequestFactoryModule.java:42) 
    ... 64 more 
    [WARN] Failed startup of context com.g[email protected]7c125c9e{/,C:\Rodrigo\Desenvolvimento\Glazier\glazier\src\main\webapp} 
com.google.inject.ProvisionException: Guice provision errors: 

1) Error in custom provider, java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 
    at com.kradcifer.glazier.server.requestfactory.InjectedRequestFactoryModule.getValidatorFactory(InjectedRequestFactoryModule.java:42) 
    while locating javax.validation.ValidatorFactory 
    at com.kradcifer.glazier.server.requestfactory.InjectedRequestFactoryModule.getValidator(InjectedRequestFactoryModule.java:59) 
    while locating javax.validation.Validator 
    for parameter 1 at com.kradcifer.glazier.server.requestfactory.InjectedServiceLayerDecorator.<init>(InjectedServiceLayerDecorator.java:36) 
    while locating com.kradcifer.glazier.server.requestfactory.InjectedServiceLayerDecorator 
    while locating com.google.web.bindery.requestfactory.server.ServiceLayerDecorator 
    for parameter 1 at com.kradcifer.glazier.server.requestfactory.InjectedRequestFactoryServlet.<init>(InjectedRequestFactoryServlet.java:25) 
    while locating com.kradcifer.glazier.server.requestfactory.InjectedRequestFactoryServlet 

1 error 
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:741) 
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:763) 
    at com.google.inject.servlet.ServletDefinition.init(ServletDefinition.java:74) 
    at com.google.inject.servlet.ManagedServletPipeline.init(ManagedServletPipeline.java:86) 
    at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:106) 
    at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:168) 
    at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97) 
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) 
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:593) 
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) 
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1220) 
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:513) 
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:448) 
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:468) 
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) 
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) 
    at org.mortbay.jetty.handler.RequestLogHandler.doStart(RequestLogHandler.java:115) 
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) 
    at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) 
    at org.mortbay.jetty.Server.doStart(Server.java:222) 
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:39) 
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:672) 
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509) 
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1068) 
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:811) 
    at com.google.gwt.dev.DevMode.main(DevMode.java:311) 
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException 
    at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:106) 
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:44) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:43) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:785) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) 
    at com.google.inject.Scopes$1$1.get(Scopes.java:54) 
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:44) 
    at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:732) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:785) 
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:728) 
    at com.google.inject.spi.ProviderLookup$1.get(ProviderLookup.java:89) 
    at com.google.inject.internal.ProviderMethod.get(ProviderMethod.java:95) 
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:44) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:43) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:785) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) 
    at com.google.inject.Scopes$1$1.get(Scopes.java:54) 
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:44) 
    at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) 
    at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) 
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:79) 
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:180) 
    at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:51) 
    at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38) 
    at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62) 
    at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:79) 
    at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:180) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:43) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:785) 
    at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40) 
    at com.google.inject.Scopes$1$1.get(Scopes.java:54) 
    at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:44) 
    at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:732) 
    at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:778) 
    at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:728) 
    ... 25 more 
Caused by: java.lang.reflect.InvocationTargetException 
    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.inject.internal.ProviderMethod.get(ProviderMethod.java:101) 
    ... 59 more 
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/validation/Validation 
    at java.lang.ClassLoader.defineClass1(Native Method) 
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791) 
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) 
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) 
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71) 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361) 
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload$WebAppClassLoaderExtension.findClass(JettyLauncher.java:372) 
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:366) 
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337) 
    at com.kradcifer.glazier.server.requestfactory.InjectedRequestFactoryModule.getValidatorFactory(InjectedRequestFactoryModule.java:42) 
    ... 64 more 

另外我嘗試運行它沒有guice,指定servlet直接在web.xml上,但得到了相同的錯誤(但這次不是當我運行應用程序,但是當我啓動它)。

嘗試了很多東西,沒有任何工作......總是有同樣的錯誤。我認爲這只是一個我看不見的細節......我無法繼續下去,直到我修復它......有人知道如何去做?

謝謝。

+0

無法解決它...我的方式來解決它是刪除該項目,並再次啓動...現在它的工作原理,不知道什麼是錯的。 – Kradcifer 2012-02-07 01:08:41

回答

0

無法解決它...我的方法來解決它是刪除該項目,並再次啓動...現在它的工作原理,不知道什麼是錯的。

相關問題