升级cxf-rt-transports-http从2.2.10到3.5.5后出现NoClassDefFoundError错误求助
升级cxf-rt-transports-http从2.2.10到3.5.5后出现NoClassDefFoundError错误求助
我在项目里原本用的是cxf-rt-transports-http v2.2.10依赖,最近把版本升级到cxf-rt-transports-http v3.5.5之后,所有测试用例和代码都持续报错,实在找不到解决办法,来求助大家!
原来的依赖配置:
<dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http</artifactId> <version>2.2.10</version> </dependency>
升级后的依赖配置:
<dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http</artifactId> <version>3.5.5</version> </dependency>
抛出的错误信息:
Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.ws.model.WrapperBeanGenerator
我对比了新旧版本的依赖树,发现差异非常大:
旧版本(2.2.10)的依赖树:
[INFO] +- org.apache.cxf:cxf-rt-transports-http:jar:2.2.10:compile [INFO] | +- org.apache.cxf:cxf-api:jar:2.2.10:compile [INFO] | | +- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.2:compile [INFO] | | +- org.apache.cxf:cxf-common-utilities:jar:2.2.10:compile [INFO] | | | \- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile [INFO] | | +- org.apache.ws.commons.schema:XmlSchema:jar:1.4.5:compile [INFO] | | +- org.apache.geronimo.specs:geronimo-annotation_1.0_spec:jar:1.1.1:compile [INFO] | | +- org.codehaus.woodstox:wstx-asl:jar:3.2.9:compile [INFO] | | +- org.apache.neethi:neethi:jar:2.0.4:compile [INFO] | | \- org.apache.cxf:cxf-common-schemas:jar:2.2.10:compile [INFO] | \- org.apache.cxf:cxf-rt-core:jar:2.2.10:compile [INFO] | \- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.6:compile
新版本(3.5.5)的依赖树:
[INFO] +- org.apache.cxf:cxf-rt-transports-http:jar:3.5.5:compile [INFO] | \- org.apache.cxf:cxf-core:jar:3.5.5:compile [INFO] | +- org.glassfish.jaxb:jaxb-runtime:jar:2.3.5:compile [INFO] | | +- org.glassfish.jaxb:txw2:jar:2.3.5:compile [INFO] | | \- com.sun.activation:jakarta.activation:jar:1.2.2:runtime [INFO] | +- org.apache.ws.xmlschema:xmlschema-core:jar:2.3.0:compile [INFO] | \- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
备注:内容来源于stack exchange,提问作者PAA
相关产品推荐
相关产品推荐

