2014-03-13 85 views
1

大家好我已經構建應用程序時拋出的異常給Tomcat部署拋出異常,而我懷疑pom.xml的是源,我在網上發現,依賴是負責任的原因這個例外,總之,這裏是我的堆棧跟蹤:創建bean在構建時

GRAVE: Context initialization failed 
org.springframework.beans.factory.BeanCreationException: Error creating bean with  
name 'productWebService': Error setting property values; nested exception is 
org.springframework.beans.PropertyBatchUpdateException; nested 
PropertyAccessExceptions (1) are: 

PropertyAccessException 1: org.springframework.beans.MethodInvocationException:  
Property 'serviceBeans' threw exception; nested exception is 
java.lang.NoSuchMethodError:  
org.springframework.util.ClassUtils.isCglibProxyClass(Ljava/lang/Class;)Z 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1361) 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086) 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) 
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) 
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) 
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) 
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580) 
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) 
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) 
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) 
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) 
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) 
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701) 
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204) 
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199) 
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) 
at java.lang.Thread.run(Thread.java:662) 
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested  
PropertyAccessExceptions (1) are: 
PropertyAccessException 1: org.springframework.beans.MethodInvocationException:  
Property 'serviceBeans' threw exception; nested exception is  
java.lang.NoSuchMethodError: 
org.springframework.util.ClassUtils.isCglibProxyClass(Ljava/lang/Class;)Z 
at .....  


13 mars 2014 08:56:27 org.apache.catalina.core.StandardContext startInternal 
GRAVE: Error listenerStart 
13 mars 2014 08:56:27 org.apache.catalina.core.StandardContext startInternal 
GRAVE: Erreur de démarrage du contexte [/WebApp] suite aux erreurs précédentes 
13 mars 2014 08:56:27 org.apache.catalina.core.ApplicationContext log 
INFO: Closing Spring root WebApplicationContext 
13 mars 2014 08:56:27 org.apache.coyote.AbstractProtocolHandler start 
INFO: Starting ProtocolHandler ["http-bio-8080"] 
13 mars 2014 08:56:27 org.apache.coyote.AbstractProtocolHandler start 
INFO: Starting ProtocolHandler ["ajp-bio-8009"] 
13 mars 2014 08:56:27 org.apache.catalina.startup.Catalina start 
INFO: Server startup in 6330 ms 

這裏是我的pom.xml:

http://maven.apache.org/maven-v4_0_0.xsd「> 4.0.0 net.ma.s2m 的WebApp 戰爭 1.0快照 Web應用程序的Maven的webapp http://maven.apache.org

<properties> 
    <cxf.version>3.0.0-milestone2</cxf.version> 
    <org.springframework.version>3.0.5.RELEASE</org.springframework.version> 
</properties> 
<build> 
    <finalName>WebApp</finalName> 
</build> 
<dependencies> 
    <dependency> 
     <groupId>org.eclipse.persistence</groupId> 
     <artifactId>eclipselink</artifactId> 
     <version>2.5.0-RC1</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-frontend-jaxrs</artifactId> 
     <version>${cxf.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-transports-http</artifactId> 
     <version>${cxf.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-core</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-web</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-context</artifactId> 
     <version>${org.springframework.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-jdbc</artifactId> 
     <version>${org.springframework.version}</version> 
     <exclusions> 
      <exclusion> 
       <groupId>org.springframework</groupId> 
       <artifactId>spring-core</artifactId> 
      </exclusion> 
      <exclusion> 
       <groupId>org.springframework</groupId> 
       <artifactId>spring-beans</artifactId> 
      </exclusion> 
      <exclusion> 
       <groupId>org.springframework</groupId> 
       <artifactId>spring-context</artifactId> 
      </exclusion> 
     </exclusions> 
    </dependency> 

</dependencies> 

+0

請從MVN依賴性增加輸出:樹 –

回答

4

春3.0.5沒有這種方法。嘗試升級你的春天版本。這些庫之間可能會有一些不兼容的地方。

+0

升級到版本3.1.3.RELEASE解決了我的問題。 – Psyduck

0

您的jar文件的最有可能的一個呼籲其犯規存在於您所使用的版本Spring 3.0.5功能。

這也可能是由於罐子衝突,其中一個較舊的jar文件預計的較舊版本的春天比3.0.5這心不是在classpath中了。

您可以通過命令行來檢查你的依賴關係樹找到關於預期的jar文件作爲傳遞依賴的其他jar文件以及瞭解有關衝突。

mvn dependency:tree 
+0

嗨,我解決了這個問題。我將Spring版本升級到3.2.0,並且一切正常。我從pom.xml文件中刪除了依賴關係,然後將CXf Apache 3.0.0庫添加到類路徑中,並且它正常工作,在這裏我注意到了spring cxf的版本正在使用。所以我回到pom.xml並添加新版本的spring。 – raccio