在通過tomcat 7.0.4進行部署時,出現以下異常。我正在使用java 1.7。似乎它正在與jdk 1.6正常工作。在Tomcat中部署war文件時發生java.lang.reflect.MalformedParameterizedTypeException
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)
已經搜索了一下,發現它與彈簧瓶的版本衝突有關。
我正在使用以下彈簧罐。
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
通過用3.1.1也更換彈簧AOP-2.5.6,彈簧豆-2.5.6,彈簧上下文2.5.6 ,彈簧芯2.5.6試過。沒有幫助。
曾嘗試刪除元數據和檢查出新鮮項目,清潔構建等。但似乎沒有任何工作。有人能告訴我出路的方法嗎?與它呆了兩天。
你可以把配置文件(cxf.xml)的內容? –
對於初學者來說,停止混合彈簧版本...既可以使用2.5.6也可以使用3.1.1,但不要混合使用jar ...另外spring.jar已經包含了所有從spring - *。jars(並且不再存在)的東西在春季3之後)。 –