在Tomcat中部署war文件时的java.lang.reflect.MalformedParameterizedTypeException

时间:2013-09-26 07:56:06

标签: java spring web-services

通过tomcat 7.0.4版进行部署时,我收到以下异常。我正在使用java 1.7。看起来它正好适用于jdk 1.6。

2013-09-26 13:03:58,154 ERROR [org.springframework.web.context.ContextLoader] -
Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean wit
h name 'cxf' defined in class path resource [META-INF/cxf/cxf.xml]: Initializati
on of bean failed; nested exception is java.lang.reflect.MalformedParameterizedT
ypeException
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:264)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:261)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:164)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.
getBeansOfType(DefaultListableBeanFactory.java:308)
        at org.springframework.context.support.AbstractApplicationContext.getBea
nsOfType(AbstractApplicationContext.java:947)
        at org.springframework.context.support.AbstractApplicationContext.regist
erListeners(AbstractApplicationContext.java:701)
        at org.springframework.context.support.AbstractApplicationContext.refres
h(AbstractApplicationContext.java:377)

曾经用Google搜索并发现它与春季罐的版本冲突有关。

我正在使用以下弹簧罐。

spring-2.5.5 - tried with 2.5.6 also
spring-aop-2.5.6
spring-beans-2.5.6
spring-context-2.5.6
spring-core-2.5.6
spring-jdbc-3.1.1.RELEASE - tried with 2.5.6 also
spring-orm-3.1.1.RELEASE - tried with 2.5.6 also
spring-transaction-3.1.1.RELEASE - tried with 2.5.6 also
spring-tx-3.1.1.RELEASE - tried with 2.5.6 also

Following are the cxf jars used.

cxf-api-2.6.0
cxf-bundle-jaxrs-2.6.0
cxf-rt-bindings-soap-2.6.0
cxf-rt-bindings-xml-2.6.0
cxf-rt-core-2.6.0
cxf-rt-databinding-jaxb-2.6.0
cxf-rt-frontend-jaxws-2.6.0
cxf-rt-frontend-simple-2.6.0
cxf-rt-transports-http-2.6.0
cxf-rt-ws-addr-2.6.0
cxf-rt-ws-policy-2.6.0

尝试取代spring-aop-2.5.6,spring-beans-2.5.6,spring-context-2.5.6 ,spring-core-2.5.6,3.1.1也。没有帮助。

曾尝试删除元数据并检查新项目,清理构建等等。但似乎没有任何工作。有人能告诉我出路吗?坚持了两天。

2 个答案:

答案 0 :(得分:2)

我在运行时遇到了同样的异常。经过一天的研究,我发现我的项目正在使用spring 2.5.6。 ,这是我的spring-jdbc在3.2.2.RELEASE上的最新版本。我无法使用spring-jdbc 2.5.6,因为我正在使用2.5.6中没有的一些功能。我解决这个问题的方法就是在CLASSPATH中的spring-2.5.6.jar之前移动spring-jdbc-3.2.2.RELEASE.jar。例外情况已经发生了。希望这对一些人有帮助。

答案 1 :(得分:2)

从Java 6移动时我们遇到了同样的问题 - > 7它原来是公共池版本。 改变它    commons-pool的-1.5.7.jar 至    commons-pool的-1.6.jar 一切都很好。