Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting java.lang.NoSuchMethodError. mvn dependency:tree shows correct dependency being used
    text
    copied!<p>I am getting </p> <blockquote> <p>java.lang.NoSuchMethodError: org.apache.xml.security.algorithms.JCEMapper.translateURItoJCEID(Ljava/lang/String;)Ljava/lang/String;</p> </blockquote> <p>I have added dependency</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt; &lt;artifactId&gt;cxf-rt-ws-security&lt;/artifactId&gt; &lt;/dependency&gt; </code></pre> <p>which contains wss4.jar -> xmlsec.jar -> JCE Mapper, as can be seen from mvn dependency tree.</p> <pre><code>[INFO] \- org.apache.cxf:cxf-rt-ws-security:jar:2.7.5:compile [INFO] +- net.sf.ehcache:ehcache-core:jar:2.5.1:compile [INFO] | \- org.slf4j:slf4j-api:jar:1.6.1:compile [INFO] +- org.apache.ws.security:wss4j:jar:1.6.10:compile [INFO] | +- org.apache.santuario:xmlsec:jar:1.5.4: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:1.6.2:compile [INFO] \- commons-logging:commons-logging:jar:1.1.1:compile </code></pre> <p>I ran a test class to see where JCEMapper is being loaded from: </p> <pre><code>public class Test { public static void main(String[] args) { Class klass = JCEMapper.class; CodeSource codeSource = klass.getProtectionDomain().getCodeSource(); if ( codeSource != null) { System.out.println(codeSource.getLocation()); } } } </code></pre> <p>And i get expected output</p> <blockquote> <p>file:/C:/Users/Affan/.m2/repository/org/apache/santuario/xmlsec/1.5.4/xmlsec-1.5.4.jar</p> </blockquote> <p>When i inspect JCEMapper class under jar xmlsec-1.5.4.jar i do see the method translateURItoJCEID. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload