在Tomcat中部署war文件时的java.lang.reflect.MalformedParameterizedTypeException [英] java.lang.reflect.MalformedParameterizedTypeException when deploying war file in Tomcat

查看:143
本文介绍了在Tomcat中部署war文件时的java.lang.reflect.MalformedParameterizedTypeException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm getting the below exception when deploying through tomcat version 7.0.4. I'm using java 1.7. Seems like it is working with jdk 1.6 properly though.

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)

用谷歌搜索并发现它与弹簧罐的版本冲突有关。

Had googled and found out that it has to do with version conflicts with spring jars.

我正在使用以下春季罐子。

I'm using the following spring jars.

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 with 3.1.1。没有帮助。

Tried by replacing spring-aop-2.5.6, spring-beans-2.5.6, spring-context-2.5.6 ,spring-core-2.5.6 with 3.1.1 also. Didnt help.

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

Had tried deleting metadata and checking out fresh project, clean build, etc.. but nothing seems to work. Could someone show me the way out of this. Stuck with it for two days.

推荐答案

从java 6 - > 7移动时,我们遇到了同样的问题成为公共池版本。
将它从
commons-pool-1.5.7.jar
改为
commons-pool-1.6.jar
,一切都很好。

We had this exact same issue when moving from java 6 -> 7 and it turned out to be the commons-pool version. Changed it from commons-pool-1.5.7.jar to commons-pool-1.6.jar and all was fine.

这篇关于在Tomcat中部署war文件时的java.lang.reflect.MalformedParameterizedTypeException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆