我检查了我的项目依赖项,发现所需的类存在于xmlsec-1.5.8.jar中,并且该类已经包含在内。另外从依赖结构中,我看到它没有被任何较低版本覆盖。我仍然无法找到出现此异常的原因。我正在运行Spring Boot 2.0.5 您能帮我解决以下问题吗?
Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.register(Ljava/lang/String;Ljava/lang/Class;)V
INFO] com.myproject.microservice:UserIDPasswordUpdate:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.0.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.0.5.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.6:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.6:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.6:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.0.5.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.34:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.34:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.34:compile
[INFO] | +- org.hibernate.validator:hibernate-validator:jar:6.0.12.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.3.4:compile
[INFO] | +- org.springframework:spring-web:jar:5.0.9.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:5.0.9.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:5.0.9.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.0.9.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.0.5.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:2.0.5.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.0.5.RELEASE:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] | | +- net.minidev:json-smart:jar:2.3:test
[INFO] | | | \- net.minidev:accessors-smart:jar:1.2:test
[INFO] | | | \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] | | \- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | +- org.assertj:assertj-core:jar:3.9.1:test
[INFO] | +- org.mockito:mockito-core:jar:2.15.0:test
[INFO] | | +- net.bytebuddy:byte-buddy:jar:1.7.11:test
[INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.7.11:test
[INFO] | | \- org.objenesis:objenesis:jar:2.6:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] | +- org.springframework:spring-core:jar:5.0.9.RELEASE:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.0.9.RELEASE:compile
[INFO] | +- org.springframework:spring-test:jar:5.0.9.RELEASE:test
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.5.1:test
[INFO] +- org.springframework.ws:spring-ws-core:jar:3.0.3.RELEASE:compile
[INFO] | +- org.springframework.ws:spring-xml:jar:3.0.3.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.0.9.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:5.0.9.RELEASE:compile
[INFO] | +- org.springframework:spring-oxm:jar:5.0.9.RELEASE:compile
[INFO] | \- commons-io:commons-io:jar:2.5:compile
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.0.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:2.0.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.0.5.RELEASE:compile
[INFO] | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.19:compile
[INFO] +- org.springframework.boot:spring-boot-starter-log4j2:jar:2.0.5.RELEASE:compile
[INFO] | +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.10.0:compile
[INFO] | | \- org.apache.logging.log4j:log4j-api:jar:2.10.0:compile
[INFO] | +- org.apache.logging.log4j:log4j-core:jar:2.10.0:compile
[INFO] | +- org.apache.logging.log4j:log4j-jul:jar:2.10.0:compile
[INFO] | \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.7.3:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.6:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.4:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] +- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.0.5.RELEASE:compile
[INFO] | +- com.zaxxer:HikariCP:jar:2.7.9:compile
[INFO] | \- org.springframework:spring-jdbc:jar:5.0.9.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:5.0.9.RELEASE:compile
[INFO] +- com.h2database:h2:jar:1.4.197:compile
[INFO] +- com.oracle:ojdbc6:jar:11.2.0.3:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.0.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:2.0.5.RELEASE:compile
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.13:compile
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | +- org.hibernate:hibernate-core:jar:5.2.17.Final:compile
[INFO] | | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.2.Final:compile
[INFO] | | +- org.javassist:javassist:jar:3.22.0-GA:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.jboss:jandex:jar:2.0.3.Final:compile
[INFO] | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:2.0.10.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:2.0.10.RELEASE:compile
[INFO] | | \- org.springframework:spring-orm:jar:5.0.9.RELEASE:compile
[INFO] | \- org.springframework:spring-aspects:jar:5.0.9.RELEASE:compile
[INFO] +- com.billdesk:billdesk:jar:1.0:system
[INFO] +- com.sun.xml.wss:xws-security:jar:3.0:compile
[INFO] | +- javax.xml.soap:saaj-api:jar:1.3:compile
[INFO] | +- javax.mail:mail:jar:1.4:compile
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.3.0:compile
[INFO] | +- javax.xml.crypto:xmldsig:jar:1.0:compile
[INFO] | \- javax.xml.ws:jaxws-api:jar:2.1:compile
[INFO] +- javax.xml:jaxrpc-api:jar:1.1:compile
[INFO] +- org.apache.axis:axis-jaxrpc:jar:1.4:compile
[INFO] +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.0.1:compile
[INFO] | +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] | +- asm:asm:jar:3.3.1:compile
[INFO] | +- org.apache.cxf:cxf-core:jar:3.0.1:compile
[INFO] | | +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.0:compile
[INFO] | | | \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] | | \- org.apache.ws.xmlschema:xmlschema-core:jar:2.1.0:compile
[INFO] | +- org.apache.cxf:cxf-rt-bindings-xml:jar:3.0.1:compile
[INFO] | +- org.apache.cxf:cxf-rt-frontend-simple:jar:3.0.1:compile
[INFO] | +- org.apache.cxf:cxf-rt-transports-http:jar:3.0.1:compile
[INFO] | \- org.apache.cxf:cxf-rt-ws-addr:jar:3.0.1:compile
[INFO] | \- org.apache.cxf:cxf-rt-ws-policy:jar:3.0.1:compile
[INFO] +- org.apache.cxf:cxf-rt-ws-security:jar:3.2.5:compile
[INFO] | +- org.apache.cxf:cxf-rt-security-saml:jar:3.2.5:compile
[INFO] | | \- org.apache.cxf:cxf-rt-security:jar:3.2.5:compile
[INFO] | +- net.sf.ehcache:ehcache:jar:2.10.5:compile
[INFO] | +- org.apache.wss4j:wss4j-ws-security-dom:jar:2.2.2:compile
[INFO] | | \- org.apache.wss4j:wss4j-ws-security-common:jar:2.2.2:compile
[INFO] | | +- org.opensaml:opensaml-saml-impl:jar:3.3.0:compile
[INFO] | | | +- org.opensaml:opensaml-profile-api:jar:3.3.0:compile
[INFO] | | | | \- org.opensaml:opensaml-core:jar:3.3.0:compile
[INFO] | | | | \- io.dropwizard.metrics:metrics-core:jar:3.2.6:compile
[INFO] | | | +- org.opensaml:opensaml-saml-api:jar:3.3.0:compile
[INFO] | | | | +- org.opensaml:opensaml-xmlsec-api:jar:3.3.0:compile
[INFO] | | | | \- org.opensaml:opensaml-soap-api:jar:3.3.0:compile
[INFO] | | | +- org.opensaml:opensaml-security-impl:jar:3.3.0:compile
[INFO] | | | | \- org.opensaml:opensaml-security-api:jar:3.3.0:compile
[INFO] | | | | +- org.cryptacular:cryptacular:jar:1.1.1:compile
[INFO] | | | | \- org.bouncycastle:bcprov-jdk15on:jar:1.54:compile
[INFO] | | | +- org.opensaml:opensaml-xmlsec-impl:jar:3.3.0:compile
[INFO] | | | +- net.shibboleth.utilities:java-support:jar:7.3.0:compile
[INFO] | | | | \- com.google.guava:guava:jar:19.0:compile
[INFO] | | | \- commons-codec:commons-codec:jar:1.11:compile
[INFO] | | +- org.opensaml:opensaml-xacml-impl:jar:3.3.0:compile
[INFO] | | | \- org.opensaml:opensaml-xacml-api:jar:3.3.0:compile
[INFO] | | +- org.opensaml:opensaml-xacml-saml-impl:jar:3.3.0:compile
[INFO] | | | \- org.opensaml:opensaml-xacml-saml-api:jar:3.3.0:compile
[INFO] | | +- org.jasypt:jasypt:jar:1.9.2:compile
[INFO] | | \- org.apache.geronimo.javamail:geronimo-javamail_1.4_mail:jar:1.8.4:compile
[INFO] | +- org.apache.wss4j:wss4j-policy:jar:2.2.2:compile
[INFO] | | \- org.apache.neethi:neethi:jar:3.1.1:compile
[INFO] | +- org.apache.wss4j:wss4j-ws-security-stax:jar:2.2.2:compile
[INFO] | | \- org.apache.wss4j:wss4j-bindings:jar:2.2.2:compile
[INFO] | \- org.apache.wss4j:wss4j-ws-security-policy-stax:jar:2.2.2:compile
[INFO] +- org.apache.ws.security:wss4j:jar:1.6.19:compile
[INFO] | +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | +- org.apache.santuario:xmlsec:jar:1.5.8:compile
[INFO] | \- org.opensaml:opensaml:jar:2.5.1-1:compile
[INFO] | \- org.opensaml:openws:jar:1.4.2-1:compile
[INFO] | \- org.opensaml:xmltooling:jar:1.3.2-1:compile
[INFO] | \- joda-time:joda-time:jar:2.9.9:compile
[INFO] +- javax.activation:activation:jar:1.1.1:compile
[INFO] \- org.apache.cxf:cxf-rt-bindings-soap:jar:3.0.1:compile
[INFO] +- org.apache.cxf:cxf-rt-wsdl:jar:3.0.1:compile
[INFO] | \- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO] \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.0.1:compile
[INFO] +- com.sun.xml.bind:jaxb-impl:jar:2.2.10-b140310.1920:compile
[INFO] \- com.sun.xml.bind:jaxb-core:jar:2.2.10-b140310.1920:compile
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.7.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/oracle/ojdbc6 -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.billdesk</groupId>
<artifactId>billdesk</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/billdeskenc-1.0.jar</systemPath>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.wss4j/wss4j-ws-security-common -->
<!-- <dependency> <groupId>org.apache.wss4j</groupId> <artifactId>wss4j-ws-security-common</artifactId>
<version>2.0.3</version> </dependency> -->
<!-- -->
<dependency>
<groupId>com.sun.xml.wss</groupId>
<artifactId>xws-security</artifactId>
<version>3.0</version>
<exclusions>
<exclusion>
<groupId>javax.xml.stream</groupId>
<artifactId>stax-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/axis/axis-jaxrpc -->
<dependency>
<groupId>axis</groupId>
<artifactId>axis-jaxrpc</artifactId>
<version>1.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-rt-frontend-jaxws -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.0.1</version>
<exclusions>
<exclusion>
<artifactId>cxf-rt-transports-http</artifactId>
<groupId>org.apache.cxf</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- excluding -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-security</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.ws.security</groupId>
<artifactId>wss4j</artifactId>
<version>1.6.19</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.activation/activation -->
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-bindings-soap</artifactId>
<version>3.0.1</version>
<scope>compile</scope>
</dependency>
<!-- excluding -->
<!-- <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<version>3.0.1</version>
<scope>compile</scope>
</dependency> -->
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.0.1</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/xml-security/xmlsec -->
</dependencies>
<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.cxf
</groupId>
<artifactId>
cxf-codegen-plugin
</artifactId>
<versionRange>
[${org.apache.cxf.version},)
</versionRange>
<goals>
<goal>wsdl2java</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.0.4</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>wsdl2java</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/cxf</source>
</sources>
</configuration>
</execution>
</executions>
<configuration>
<source>1.8</source>
<target>1.8</target>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdls/AccountInquiry.wsdl</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
</plugin>
答案 0 :(得分:0)
我已经找到了上述问题的解决方案,这是由于相互依赖的问题引起的。合并几个问题或开发的Maven依赖是其背后的原因。我最后要做的就是在所有其他相关依赖项的基础上声明cxf版本,并为所有相关依赖项引用该cxf版本,终于可以了!
<properties>
<cxf.version>2.7.14</cxf.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-ws-security</artifactId>
<version>${cxf.version}</version>
</dependency>