我有一个使用Spring 4.2.2的项目。在这个项目中,我使用了另一个依赖于spring-ws 2.2.2的项目。看起来像spring-ws想要在版本4.0.9中使用spring-aop和其他spring库。当我想部署和运行我的Web服务时,这似乎导致:
java.lang.NoSuchMethodError: org.springframework.aop.scope.ScopedProxyUtils.isScopedTarget
根据{{3}},isScopedTarget直到春季4.1.4才定义。
那么:有什么方法可以将spring-ws 2.2.2与spring 4.2.x一起使用?
以下是在包含项目上运行mvn dependency:tree
的输出:
[INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ net4care-mhd-fhir-server ---
[INFO] ca.uhn.hapi.fhir:net4care-mhd-fhir-server:war:1.3-SNAPSHOT
[INFO] +- ca.uhn.hapi.fhir:hapi-fhir-base:jar:1.3-SNAPSHOT:compile
[INFO] | +- javax.json:javax.json-api:jar:1.0:compile
[INFO] | +- org.glassfish:javax.json:jar:1.0.4:compile
[INFO] | +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile
[INFO] | | +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] | | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] | +- commons-codec:commons-codec:jar:1.10:compile
[INFO] | +- commons-io:commons-io:jar:2.4:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.10:compile
[INFO] | +- org.slf4j:jcl-over-slf4j:jar:1.7.10:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.4:compile
[INFO] | \- org.apache.httpcomponents:httpcore:jar:4.4:compile
[INFO] +- ca.uhn.hapi.fhir:hapi-fhir-structures-dstu2:jar:1.3-SNAPSHOT:compile
[INFO] +- ca.uhn.hapi.fhir:hapi-fhir-testpage-overlay:war:1.3-SNAPSHOT:provided
[INFO] +- ch.qos.logback:logback-classic:jar:1.1.2:compile
[INFO] | \- ch.qos.logback:logback-core:jar:1.1.2:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO] +- org.thymeleaf:thymeleaf:jar:2.1.4.RELEASE:compile
[INFO] | +- ognl:ognl:jar:3.0.8:compile
[INFO] | +- org.javassist:javassist:jar:3.16.1-GA:compile
[INFO] | \- org.unbescape:unbescape:jar:1.1.0.RELEASE:compile
[INFO] +- org.ebaysf.web:cors-filter:jar:1.0.1:compile
[INFO] +- org.net4care:xds-connector:jar:0.0.6-SNAPSHOT:compile
[INFO] | +- org.springframework:spring-test:jar:4.2.1.RELEASE:compile
[INFO] | | \- org.springframework:spring-core:jar:4.2.1.RELEASE:compile
[INFO] | +- org.springframework.ws:spring-ws-core:jar:2.2.2.RELEASE:compile
[INFO] | | +- org.springframework.ws:spring-xml:jar:2.2.2.RELEASE:compile
[INFO] | | | \- org.springframework:spring-context:jar:4.2.1.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:4.0.9.RELEASE:compile
[INFO] | | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | +- org.springframework:spring-beans:jar:4.2.1.RELEASE:compile
[INFO] | | +- org.springframework:spring-oxm:jar:4.0.9.RELEASE:compile
[INFO] | | +- org.springframework:spring-web:jar:4.2.1.RELEASE:compile
[INFO] | | \- org.springframework:spring-webmvc:jar:4.2.1.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:4.2.1.RELEASE:compile
[INFO] | +- org.apache.ws.commons.axiom:axiom-api:jar:1.2.14:compile
[INFO] | | +- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.1:compile
[INFO] | | +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:compile
[INFO] | | +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | | +- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
[INFO] | | \- org.apache.james:apache-mime4j-core:jar:0.7.2:compile
[INFO] | +- org.apache.ws.commons.axiom:axiom-impl:jar:1.2.14:compile
[INFO] | \- xmlunit:xmlunit:jar:1.6:compile
[INFO] +- net.sourceforge.cobertura:cobertura:jar:2.1.1:provided
[INFO] | +- org.ow2.asm:asm:jar:5.0.1:provided
[INFO] | +- org.ow2.asm:asm-tree:jar:5.0.1:provided
[INFO] | +- org.ow2.asm:asm-commons:jar:5.0.1:provided
[INFO] | +- org.ow2.asm:asm-util:jar:5.0.1:provided
[INFO] | +- org.ow2.asm:asm-analysis:jar:5.0.1:provided
[INFO] | +- oro:oro:jar:2.0.8:provided
[INFO] | +- jaxen:jaxen:jar:1.1.4:compile
[INFO] | +- org.apache.ant:ant:jar:1.8.3:provided
[INFO] | | \- org.apache.ant:ant-launcher:jar:1.8.3:provided
[INFO] | +- org.apache.ant:ant-junit:jar:1.8.3:provided
[INFO] | +- org.mortbay.jetty:servlet-api-2.5:jar:6.1.14:provided
[INFO] | +- org.mortbay.jetty:jetty-util:jar:6.1.14:provided
[INFO] | \- com.sun:tools:jar:0:system
[INFO] +- junit:junit:jar:4.12:test
[INFO] +- org.hamcrest:java-hamcrest:jar:2.0.0.0:test
[INFO] \- org.mockito:mockito-all:jar:1.10.19:test
答案 0 :(得分:2)
我通过在包含项目的pom中添加以下排除来解决了这个问题:
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>2.2.2.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
</exclusions>
</dependency>