Solved

NoSuchMethodError when using security api

Posted on 2009-07-07
4
2,377 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

713 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