gpt4 book ai didi

java.lang.NoSuchMethodError : org. apache.xml.security.transforms.Transform.init()V

转载 作者:行者123 更新时间:2023-11-30 06:29:11 24 4
gpt4 key购买 nike

我有一个 java 类负责连接到 Web 服务以验证证书,情况是当我采取步骤调用 WS 时,它返回以下错误:java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init () V

我尝试过删除库,但不起作用。

我的pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.onelogin</groupId>
<artifactId>java-saml-tookit-samples</artifactId>
<version>2.0.1</version>
</parent>

<artifactId>samlAutentica</artifactId>
<packaging>war</packaging>
<name>samlAutentica</name>

<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.onelogin</groupId>
<artifactId>java-saml</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>org.apache.ws.security</groupId>
<artifactId>wss4j</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>2.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-cas</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-asm</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>1.3.1.RELEASE</version>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>3.7.5</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.opensaml</groupId>
<artifactId>opensaml</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1-beta-6</version>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.4</version>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>com.liferay</groupId>
<artifactId>nl.captcha.simplecaptcha</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-webflow</artifactId>
<version>2.3.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>1.5.8</version>
</dependency>
</dependencies>

堆栈跟踪

java.lang.NoSuchMethodError: 
org.apache.xml.security.transforms.Transform.init()V
org.apache.ws.security.WSSConfig.staticInit(WSSConfig.java:253)
org.apache.ws.security.WSSConfig.<init>(WSSConfig.java:269)
org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:278)
org.apache.ws.security.WSSConfig.getDefaultWSConfig(WSSConfig.java:287)
org.apache.ws.security.message.WSSecBase.<init>(WSSecBase.java:47)
org.apache.ws.security.message.WSSecSignature.<init>
(WSSecSignature.java:126)
es.sag.autentica.afirma.ClientHandler.createBinarySecurityToken(ClientHandle
r.java:209)
es.sag.autentica.afirma.ClientHandler.invoke(ClientHandler.java:107)
org.apache.axis.client.AxisClient.invoke(AxisClient.java:121)
org.apache.axis.client.Call.invokeEngine(Call.java:2784)
org.apache.axis.client.Call.invoke(Call.java:2767)
org.apache.axis.client.Call.invoke(Call.java:2443)
org.apache.axis.client.Call.invoke(Call.java:2366)
org.apache.axis.client.Call.invoke(Call.java:1812)
es.sag.autentica.afirma.RequestConstructor.invokeWS(RequestConstructor.java:
175)
es.sag.autentica.afirma.certificado.Certificado.<init>(Certificado.java:105)
es.sag.autentica.saml.utils.Utility.validateCertificate(Utility.java:783)
org.apache.jsp.index_jsp._jspService(index_jsp.java:130)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:4
43)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

谢谢!

最佳答案

正如我在第一条评论中建议的那样。您有冲突的 jar xmlsec.jar作为来自具有许多不同版本的其他 jar 的依赖项导入到您的项目中(我数了 3 个版本)。所有 3 个版本中,版本 1.5.6 之一最终被选中,这是缺少 init() 的那个方法wss4j.jar:1.5.6来电。

这可以通过调用maven中的依赖树来观察,我在这里发布结果:

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.onelogin:samlAutentica:war:2.0.1
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework.ldap:spring-ldap-core:jar -> version 2.3.1.RELEASE vs 1.3.1.RELEASE @ line 165, column 17
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework:spring-webmvc:jar -> version 3.1.2.RELEASE vs 3.0.3.RELEASE @ line 215, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building samlAutentica 2.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ samlAutentica ---
[INFO] com.onelogin:samlAutentica:war:2.0.1
[INFO] +- com.onelogin:java-saml:jar:2.0.1:compile
[INFO] | +- com.onelogin:java-saml-core:jar:2.0.1:compile
[INFO] | | +- (org.slf4j:slf4j-api:jar:1.7.12:compile - version managed from 1.7.14; omitted for duplicate)
[INFO] | | +- (joda-time:joda-time:jar:2.9.4:compile - omitted for duplicate)
[INFO] | | +- (org.apache.commons:commons-lang3:jar:3.4:compile - omitted for duplicate)
[INFO] | | +- (org.apache.santuario:xmlsec:jar:2.0.7:compile - omitted for duplicate)
[INFO] | | \- (commons-codec:commons-codec:jar:1.10:compile - omitted for duplicate)
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.12:compile
[INFO] | +- joda-time:joda-time:jar:2.9.4:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] | +- (org.apache.santuario:xmlsec:jar:2.0.7:compile - omitted for conflict with 1.5.8)
[INFO] | \- commons-codec:commons-codec:jar:1.10:compile
[INFO] +- org.apache.axis:axis:jar:1.4:compile
[INFO] +- log4j:log4j:jar:1.2.15:provided (scope not updated to compile)
[INFO] | \- (javax.mail:mail:jar:1.4:provided - omitted for duplicate)
[INFO] +- org.apache.logging.log4j:log4j-1.2-api:jar:2.3:compile
[INFO] | +- org.apache.logging.log4j:log4j-api:jar:2.3:compile
[INFO] | \- org.apache.logging.log4j:log4j-core:jar:2.3:compile
[INFO] | \- (org.apache.logging.log4j:log4j-api:jar:2.3:compile - omitted for duplicate)
[INFO] +- org.apache.ws.security:wss4j:jar:1.5.6:compile
[INFO] | +- commons-logging:commons-logging:jar:1.1:compile
[INFO] | | +- (log4j:log4j:jar:1.2.12:compile - omitted for conflict with 1.2.15)
[INFO] | | +- logkit:logkit:jar:1.0.1:compile
[INFO] | | +- avalon-framework:avalon-framework:jar:4.1.3:compile
[INFO] | | \- (javax.servlet:servlet-api:jar:2.3:compile - omitted for conflict with 2.5)
[INFO] | +- (org.apache.santuario:xmlsec:jar:1.4.2:compile - omitted for conflict with 2.0.7)
[INFO] | +- xalan:xalan:jar:2.7.1:compile
[INFO] | | \- xalan:serializer:jar:2.7.1:compile
[INFO] | | \- (xml-apis:xml-apis:jar:1.3.04:compile - omitted for conflict with 1.0.b2)
[INFO] | \- bouncycastle:bcprov-jdk14:jar:140:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided (scope not updated to compile)
[INFO] +- org.springframework.ldap:spring-ldap-core:jar:1.3.1.RELEASE:compile
[INFO] | +- (commons-logging:commons-logging:jar:1.0.4:compile - omitted for conflict with 1.1)
[INFO] | +- (commons-lang:commons-lang:jar:2.5:compile - omitted for conflict with 2.6)
[INFO] | +- (org.springframework:spring-core:jar:3.0.5.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | +- (org.springframework:spring-beans:jar:3.0.5.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | \- org.springframework:spring-tx:jar:3.0.5.RELEASE:compile
[INFO] | +- (aopalliance:aopalliance:jar:1.0:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-aop:jar:3.0.5.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | +- (org.springframework:spring-beans:jar:3.0.5.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-context:jar:3.0.5.RELEASE:compile - omitted for conflict with 3.0.6.RELEASE)
[INFO] | \- (org.springframework:spring-core:jar:3.0.5.RELEASE:compile - omitted for duplicate)
[INFO] +- javax.xml:jaxrpc-api:jar:1.1:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- org.jdom:jdom:jar:1.1:compile
[INFO] +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] +- org.springframework.security:spring-security-cas:jar:3.1.0.RELEASE:compile
[INFO] | +- (org.springframework.security:spring-security-web:jar:3.1.0.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] | +- org.jasig.cas.client:cas-client-core:jar:3.1.12:compile
[INFO] | | \- (commons-logging:commons-logging:jar:1.1:compile - omitted for duplicate)
[INFO] | +- org.springframework:spring-web:jar:3.0.6.RELEASE:compile
[INFO] | | +- (aopalliance:aopalliance:jar:1.0:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:3.0.6.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] | | +- (org.springframework:spring-context:jar:3.0.6.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] | | \- (org.springframework:spring-core:jar:3.0.6.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] | +- (org.springframework.security:spring-security-core:jar:3.1.0.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] | +- (org.springframework:spring-context:jar:3.0.6.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | +- (org.springframework:spring-beans:jar:3.0.6.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] | \- (org.springframework:spring-core:jar:3.0.6.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] +- org.springframework.security:spring-security-config:jar:3.0.5.RELEASE:compile
[INFO] | \- (org.springframework.security:spring-security-core:jar:3.0.5.RELEASE:compile - omitted for conflict with 3.1.0.RELEASE)
[INFO] +- org.springframework.security:spring-security-core:jar:3.0.5.RELEASE:compile
[INFO] | +- (org.springframework:spring-expression:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] | +- (org.springframework:spring-context:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.6.RELEASE)
[INFO] | +- (org.springframework:spring-tx:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] | +- (org.springframework:spring-aop:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- org.aspectj:aspectjrt:jar:1.6.8:compile
[INFO] | \- org.aspectj:aspectjweaver:jar:1.6.8:compile
[INFO] +- org.springframework.security:spring-security-taglibs:jar:3.0.5.RELEASE:compile
[INFO] | +- (org.springframework.security:spring-security-web:jar:3.0.5.RELEASE:compile - omitted for conflict with 3.1.0.RELEASE)
[INFO] | +- org.springframework.security:spring-security-acl:jar:3.0.5.RELEASE:compile
[INFO] | | +- (org.springframework.security:spring-security-core:jar:3.0.5.RELEASE:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-context-support:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | | \- (org.springframework:spring-jdbc:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.6.RELEASE)
[INFO] | \- (org.springframework:spring-web:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.6.RELEASE)
[INFO] +- org.springframework.security:spring-security-web:jar:3.0.5.RELEASE:compile
[INFO] | +- (org.springframework.security:spring-security-core:jar:3.0.5.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-web:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.6.RELEASE)
[INFO] +- org.springframework:spring-aop:jar:3.0.3.RELEASE:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- (org.springframework:spring-asm:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] | \- (org.springframework:spring-core:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] +- org.springframework:spring-asm:jar:3.0.3.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:3.0.3.RELEASE:compile
[INFO] | \- (org.springframework:spring-core:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] +- org.springframework:spring-context:jar:3.0.3.RELEASE:compile
[INFO] | +- (org.springframework:spring-aop:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] | +- (org.springframework:spring-expression:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-asm:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] +- org.springframework:spring-context-support:jar:3.0.3.RELEASE:compile
[INFO] | +- (org.springframework:spring-beans:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-context:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-core:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] +- org.springframework:spring-core:jar:3.0.3.RELEASE:compile
[INFO] | +- (org.springframework:spring-asm:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.1)
[INFO] +- org.springframework:spring-expression:jar:3.0.3.RELEASE:compile
[INFO] | \- (org.springframework:spring-core:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] +- org.springframework:spring-jdbc:jar:3.0.3.RELEASE:compile
[INFO] | +- (org.springframework:spring-beans:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-tx:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.5.RELEASE)
[INFO] +- net.sf.jasperreports:jasperreports:jar:3.7.5:compile
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO] | | \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.1)
[INFO] | +- commons-collections:commons-collections:jar:2.1:compile
[INFO] | +- commons-digester:commons-digester:jar:1.7:compile
[INFO] | | +- (commons-beanutils:commons-beanutils:jar:1.6:compile - omitted for conflict with 1.8.0)
[INFO] | | +- (commons-logging:commons-logging:jar:1.0:compile - omitted for conflict with 1.1)
[INFO] | | +- (commons-collections:commons-collections:jar:2.1:compile - omitted for duplicate)
[INFO] | | \- (xml-apis:xml-apis:jar:1.0.b2:compile - omitted for duplicate)
[INFO] | +- (commons-logging:commons-logging:jar:1.0.2:compile - omitted for conflict with 1.1)
[INFO] | +- com.lowagie:itext:jar:2.1.7:compile
[INFO] | | +- bouncycastle:bcmail-jdk14:jar:138:compile
[INFO] | | +- (bouncycastle:bcprov-jdk14:jar:138:compile - omitted for conflict with 140)
[INFO] | | \- org.bouncycastle:bctsp-jdk14:jar:1.38:compile
[INFO] | | +- org.bouncycastle:bcprov-jdk14:jar:1.38:compile
[INFO] | | \- org.bouncycastle:bcmail-jdk14:jar:1.38:compile
[INFO] | | \- (org.bouncycastle:bcprov-jdk14:jar:1.38:compile - omitted for duplicate)
[INFO] | +- jfree:jcommon:jar:1.0.15:compile
[INFO] | +- jfree:jfreechart:jar:1.0.12:compile
[INFO] | | \- (jfree:jcommon:jar:1.0.15:compile - omitted for duplicate)
[INFO] | +- (xml-apis:xml-apis:jar:1.3.02:compile - omitted for conflict with 1.0.b2)
[INFO] | \- eclipse:jdtcore:jar:3.1.0:compile
[INFO] +- org.json:json:jar:20160810:compile
[INFO] +- org.springframework:spring:jar:2.5.6:compile
[INFO] | \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.1)
[INFO] +- org.springframework:spring-webmvc:jar:3.0.3.RELEASE:compile
[INFO] | +- (org.springframework:spring-asm:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-beans:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-context:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-context-support:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-core:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | +- (org.springframework:spring-expression:jar:3.0.3.RELEASE:compile - omitted for duplicate)
[INFO] | \- (org.springframework:spring-web:jar:3.0.3.RELEASE:compile - omitted for conflict with 3.0.6.RELEASE)
[INFO] +- org.opensaml:opensaml:jar:1.1:compile
[INFO] +- javax.mail:mail:jar:1.4:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- jaxen:jaxen:jar:1.1-beta-6:compile
[INFO] | +- (jaxen:jaxen:jar:1.1-beta-4:compile - omitted for cycle)
[INFO] | +- (dom4j:dom4j:jar:1.5.2:compile - omitted for conflict with 1.6.1)
[INFO] | +- (jaxen:jaxen:jar:1.0-FCS:compile - omitted for cycle)
[INFO] | +- jdom:jdom:jar:1.0:compile
[INFO] | +- xerces:xmlParserAPIs:jar:2.6.2:compile
[INFO] | +- xerces:xercesImpl:jar:2.6.2:compile
[INFO] | \- xom:xom:jar:1.0b3:compile
[INFO] | +- (xerces:xmlParserAPIs:jar:2.6.1:compile - omitted for conflict with 2.6.2)
[INFO] | +- (xerces:xercesImpl:jar:2.2.1:compile - omitted for conflict with 2.6.2)
[INFO] | +- com.ibm.icu:icu4j:jar:2.6.1:compile
[INFO] | +- (xalan:xalan:jar:2.6.0:compile - omitted for conflict with 2.7.1)
[INFO] | \- org.ccil.cowan.tagsoup:tagsoup:jar:0.9.7:compile
[INFO] +- commons-discovery:commons-discovery:jar:0.4:compile
[INFO] | \- (commons-logging:commons-logging:jar:1.0.4:compile - omitted for conflict with 1.1)
[INFO] +- wsdl4j:wsdl4j:jar:1.6.2:compile
[INFO] +- com.liferay:nl.captcha.simplecaptcha:jar:1.1.1:compile
[INFO] +- org.springframework.webflow:spring-webflow:jar:2.3.3.RELEASE:compile
[INFO] | +- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.1)
[INFO] | +- opensymphony:ognl:jar:2.6.11:compile
[INFO] | +- org.springframework.webflow:spring-binding:jar:2.3.3.RELEASE:compile
[INFO] | | +- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.1)
[INFO] | | +- (opensymphony:ognl:jar:2.6.11:compile - omitted for duplicate)
[INFO] | | +- (org.springframework:spring-beans:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | | +- (org.springframework:spring-context:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | | +- (org.springframework:spring-core:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | | \- (org.springframework:spring-expression:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | +- org.springframework.webflow:spring-js:jar:2.3.3.RELEASE:compile
[INFO] | | +- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.1)
[INFO] | | +- org.springframework.webflow:spring-js-resources:jar:2.3.3.RELEASE:compile
[INFO] | | +- (org.springframework:spring-beans:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | | +- (org.springframework:spring-context:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | | +- (org.springframework:spring-core:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | | +- (org.springframework:spring-web:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.6.RELEASE)
[INFO] | | \- (org.springframework:spring-webmvc:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | +- (org.springframework:spring-beans:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | +- (org.springframework:spring-context:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | +- (org.springframework:spring-core:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | +- (org.springframework:spring-expression:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] | +- (org.springframework:spring-web:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.6.RELEASE)
[INFO] | \- (org.springframework:spring-webmvc:jar:4.0.0.RELEASE:compile - omitted for conflict with 3.0.3.RELEASE)
[INFO] \- org.apache.santuario:xmlsec:jar:1.5.8:compile
[INFO] \- (commons-logging:commons-logging:jar:1.1.1:compile - omitted for conflict with 1.1)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.336s
[INFO] Finished at: Fri Sep 29 15:03:00 EEST 2017
[INFO] Final Memory: 13M/245M
[INFO] ------------------------------------------------------------------------
  • 首先,为什么您有 org.springframework.ldap:spring-ldap-core:jar 的重复依赖项和org.springframework:spring-webmvc:jar ?您应该只保留一个。

  • 其次,数一下有多少次org.apache.santuario:xmlsec出现了多少个不同的版本(我数了4次,有3个不同的版本: 2.0.71.4.21.5.8 。前两个因冲突而被省略,选择的是最后一个 1.5.8 ,缺少 init 方法。

所以,你有一个非常困惑的pom.xml就依赖性而言。您应该尝试清理它并仅使用您需要的依赖项。例如你应该 要么尝试降级/排除所有要使用的xmlsec-1.4.2并摆脱你的xmlsec-1.5.8依赖项,或升级所有内容以使用 xmlsec-1.5.8 。我发现wss4j-1.6.19xmlsec-1.5.8一起工作所以删除你的 xmlsec依赖并更改 wss4j 的版本依赖于1.6.19

<dependency>
<groupId>org.apache.ws.security</groupId>
<artifactId>wss4j</artifactId>
<version>1.6.19</version>
</dependency>

执行mvn clean在再次构建/运行您的项目之前清理您的目标和依赖项。

更新不要删除您的xmlsec-1.5.8依赖性,因为来自 com.onelogin:java-saml:jar:2.0.1 的一个将会占上风。只需让它存在并尝试构建/运行您的项目

<dependency>
<groupId>org.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>1.5.8</version>
</dependency>

我建议你也降级com.onelogin:java-saml:jar:2.0.1到依赖于 xmlsec-1.5.8 的版本而不是2.0.7 。尝试使您的依赖项尽可能干净,并且mvn dependency:tree是一个可以帮助您的好工具。

关于java.lang.NoSuchMethodError : org. apache.xml.security.transforms.Transform.init()V,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46485860/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com