2013-07-14 28 views
1

我使用Spring 3.2.3.RELEASE,谷歌吉斯3.0,吉斯 - 库2.1.0,吉斯-的servlet 3.0和Hibernate 3无法启动吉斯库喷油器

,当我在servlet的模块安装JpaRepository( web.xml),我得到了运行时错误。

下面是源代码

public class JpaGuiceServletConfig extends GuiceServletContextListener { 

    @Override 
    protected Injector getInjector() { 
     return Guice.createInjector(new ServletModule(){ 
      @Override 
      protected void configureServlets() { 
       this.install(new JpaRepositoryModule("ptol-persistence-unit") { 
        @Override 
        protected void bindRepositories(RepositoryBinder binder) { 
         binder.bind(CategoryRepository.class).to("ptol-persistence-unit"); 
        } 
       }); 
       //filter("/*").through(PersistFilter.class); 
      } 
     }); 
    } 

} 

在web.xml中

<!-- Listener Configuration --> 
    <listener> 
     <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
    </listener> 

    <listener> 
     <listener-class>phattuonline.common.base.JpaGuiceServletConfig</listener-class> 
    </listener> 

我得到了错误:

Jul 10, 2013 4:37:05 PM org.apache.catalina.core.StandardContext listenerStart 
SEVERE: Exception sending context initialized event to listener instance of class phattuonline.common.base.JpaGuiceServletConfig 
java.lang.NoSuchMethodError: org.springframework.transaction.annotation.AnnotationTransactionAttributeSource.<init>(Lorg/springframework/transaction/annotation/TransactionAnnotationParser;)V 
    at com.google.code.guice.repository.configuration.JpaRepositoryModule.createTransactionAttributeSource(JpaRepositoryModule.java:283) 
    at com.google.code.guice.repository.configuration.JpaRepositoryModule.configure(JpaRepositoryModule.java:170) 
    at com.google.inject.AbstractModule.configure(AbstractModule.java:59) 
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223) 
    at com.google.inject.AbstractModule.install(AbstractModule.java:118) 
    at phattuonline.common.base.JpaGuiceServletConfig$1.configureServlets(JpaGuiceServletConfig.java:19) 
    at com.google.inject.servlet.ServletModule.configure(ServletModule.java:53) 
    at com.google.inject.AbstractModule.configure(AbstractModule.java:59) 
    at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223) 
    at com.google.inject.spi.Elements.getElements(Elements.java:101) 
    at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133) 
    at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103) 
    at com.google.inject.Guice.createInjector(Guice.java:95) 
    at com.google.inject.Guice.createInjector(Guice.java:72) 
    at com.google.inject.Guice.createInjector(Guice.java:62) 
    at phattuonline.common.base.JpaGuiceServletConfig.getInjector(JpaGuiceServletConfig.java:16) 
    at com.google.inject.servlet.GuiceServletContextListener.contextInitialized(GuiceServletContextListener.java:45) 
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765) 
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515) 
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) 
    at java.util.concurrent.FutureTask.run(Unknown Source) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
    at java.lang.Thread.run(Unknown Source) 

你知道为什么发生错误?交易有问题吗?

感谢

+0

我想这是某种罐子的冲突,可能是罐子的多个版本中使用 –

+0

我使用Maven,它会自动解决所有的罐子冲突。错误仍然发生 –

回答