一个Xfire调用失败问题
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaComplexType.getAttributes()Lorg/apache/ws/commons/schema/XmlSchemaObjectCollection;] at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) Caused by: java.lang.NoSuchMethodError: org.apache.ws.commons.schema.XmlSchemaComplexType.getAttributes()Lorg/apache/ws/commons/schema/XmlSchemaObjectCollection; at org.codehaus.xfire.wsdl11.parser.WSDLServiceBuilder.hasAttributes(WSDLServiceBuilder.java:662) at org.codehaus.xfire.wsdl11.parser.WSDLServiceBuilder.isWrapped(WSDLServiceBuilder.java:582) at org.codehaus.xfire.wsdl11.parser.WSDLServiceBuilder.visit(WSDLServiceBuilder.java:392) at org.codehaus.xfire.wsdl11.parser.WSDLServiceBuilder.build(WSDLServiceBuilder.java:195) at org.codehaus.xfire.client.Client.initFromDefinition(Client.java:264) at org.codehaus.xfire.client.Client.<init>(Client.java:236) at com.zoe.phip.infrastructure.core.XfireUtil.getData(XfireUtil.java:17)
由错误看,可知是XmlSchemaObjectCollection找不到,通过maven命令:mvn dependency:tree 查看项目依赖,
+- junit:junit:jar:4.12:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- commons-codec:commons-codec:jar:1.10:compile
[INFO] +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] +- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- org.apache.httpcomponents:httpcore:jar:4.4.5:compile
[INFO] +- org.apache.neethi:neethi:jar:3.0.3:compile
[INFO] | \- org.codehaus.woodstox:woodstox-core-asl:jar:4.2.0:compile
[INFO] | \- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] +- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO] +- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.1:compile
[INFO] +- org.apache.ws.commons.axiom:axiom-api:jar:1.2.12:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.2:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.6:compile
[INFO] | +- jaxen:jaxen:jar:1.1-beta-11:compile (version managed from 1.1.1)
[INFO] | \- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
[INFO] +- org.apache.ws.commons.axiom:axiom-impl:jar:1.2.12:compile
[INFO] | \- org.codehaus.woodstox:wstx-asl:jar:3.2.9:compile
[INFO] +- com.zoe:phip-infrastructure-core:jar:1.0-PK-SNAPSHOT:compile
[INFO] | \- org.codehaus.xfire:xfire-all:jar:1.2.6:compile
[INFO] | +- org.codehaus.xfire:xfire-aegis:jar:1.2.6:compile
[INFO] | | \- net.java.dev.stax-utils:stax-utils:jar:20040917:compile
[INFO] | +- org.codehaus.xfire:xfire-ws-security:jar:1.2.6:compile
[INFO] | | +- jmock:jmock:jar:1.0.1:compile
[INFO] | | +- xfire:opensaml:jar:1.0.1:compile
[INFO] | | +- bouncycastle:bcprov-jdk15:jar:133:compile
[INFO] | | +- xerces:xercesImpl:jar:2.7.1:compile
[INFO] | | +- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | | +- xml-security:xmlsec:jar:1.3.0:compile
[INFO] | | +- wss4j:wss4j:jar:1.5.1:compile
[INFO] | | \- commons-discovery:commons-discovery:jar:0.2:compile
[INFO] | +- org.codehaus.xfire:xfire-core:jar:1.2.6:compile
[INFO] | | +- javax.activation:activation:jar:1.1:compile
[INFO] | | +- javax.mail:mail:jar:1.4:compile
[INFO] | | +- stax:stax-api:jar:1.0.1:compile
[INFO] | | +- org.apache.ws.commons:XmlSchema:jar:1.1:compile
[INFO] | | \- jdom:jdom:jar:1.0:compile
[INFO] | +- org.codehaus.xfire:xfire-java5:jar:1.2.6:compile
[INFO] | | \- xfire:xfire-jsr181-api:jar:1.0-M1:compile
[INFO] | +- org.codehaus.xfire:xfire-generator:jar:1.2.6:compile
[INFO] | | \- org.codehaus.xfire:xfire-jaxb2:jar:1.2.6:compile
[INFO] | | \- com.sun.xml.bind:jaxb-xjc:jar:2.0.1:compile
[INFO] | +- org.codehaus.xfire:xfire-xmlbeans:jar:1.2.6:compile
[INFO] | | \- xmlbeans:xbean:jar:2.2.0:compile
[INFO] | +- org.codehaus.xfire:xfire-annotations:jar:1.2.6:compile
[INFO] | | +- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] | | \- commons-attributes:commons-attributes-api:jar:2.1:compile
[INFO] | | \- qdox:qdox:jar:1.5:compile
[INFO] | +- org.codehaus.xfire:xfire-jaxws:jar:1.2.6:compile
[INFO] | | +- javax.xml.ws:jaxws-api:jar:2.0:compile
[INFO] | | +- com.sun.xml.messaging.saaj:saaj-impl:jar:1.3:compile
[INFO] | | \- javax.xml.soap:saaj-api:jar:1.3:compile
[INFO] | \- org.codehaus.xfire:xfire-spring:jar:1.2.6:compile
[INFO] | \- org.apache.xbean:xbean-spring:jar:2.8:compile
项目中有引用
[INFO] +- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.1:compile
导到Xfire调用的时候找到这个包里面去了,并不有去找自己原本依赖的包
[INFO] | | +- org.apache.ws.commons:XmlSchema:jar:1.1:compile
所以导致找不到XmlSchemaObjectCollection报错
如果我的文章对你有帮助,就点一下推荐吧.(*^__^*)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步