Solved

NoSuchMethodError when using security api

Posted on 2009-07-07
4
2,464 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 60

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

630 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