Solved

NoSuchMethodError when using security api

Posted on 2009-07-07
4
2,239 Views
Last Modified: 2013-12-29
Hi, I am getting this error:

java.lang.NoSuchMethodError: org.apache.xpath.compiler.FunctionTable.installFunction(Ljava/lang/String;Lorg/apache/xpath/Expre

ssion;)I

        at org.apache.xml.security.Init.init(Init.java:215)

        at org.apache.ws.security.WSSConfig.<init>(WSSConfig.java:72)

        at org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:95)

        at org.apache.ws.security.WSSConfig.<clinit>(WSSConfig.java:47)

        at org.apache.ws.security.WSSecurityEngine.<clinit>(WSSecurityEngine.java:51)

        at org.apache.ws.security.handler.WSHandler.<clinit>(WSHandler.java:62)

       
********************************

I have xalan 2.6 in my classpath. Any idea how can I fix this error? I am working on Solaris.

Thanks
0
Comment
Question by:LeoKris
4 Comments
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 24799462
Check that you are passing correct parameters to installFunction:
http://xml.apache.org/xalan-j/apidocs/org/apache/xpath/compiler/FunctionTable.html

It's signature is: installFunction(java.lang.String name, java.lang.Class func)

As you can see it should be a string and then a class, not org.apache.xpath.Expression type.  You can try calling the .getClass() method of your org.apache.xpath.Expression variable.
0
 

Author Comment

by:LeoKris
ID: 24800013
Thanks mwvisa1. But Xalan-2.6.0 has over-ridden installFunction methods as :

1) installFunction(String, Expression). This one matches with the call we are making.

2) installFunction(Expression , int)

What you are talking about is in Xalan-2.7.1. I am working on 2.6.0.


0
 
LVL 26

Expert Comment

by:ksivananth
ID: 24801121
looks like a different version of the XPath library precedes the intended version in CLASSPATH!
how do you run the application?
0
 
LVL 6

Accepted Solution

by:
jwenting earned 500 total points
ID: 24801548
If there's another version on your classpath that takes precedence the 2.6 will never be used.

And if you're running (for example) from an application server the system classpath will be completely ignored so it doesn't matter one bit what you put on it.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Unable to open debugger port in Intellij idea 6 88
changeXy challenge 13 58
parentbit challenge 3 52
groupSum6 challenge 6 48
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now