Link to home
Start Free TrialLog in
Avatar of LeoKris
LeoKris

asked on

NoSuchMethodError when using security api

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
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

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.
Avatar of LeoKris
LeoKris

ASKER

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.


looks like a different version of the XPath library precedes the intended version in CLASSPATH!
how do you run the application?
ASKER CERTIFIED SOLUTION
Avatar of jwenting
jwenting
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial