问题
I am working with an Oracle 11g database (thus JDK 1.5) and trying to call a webservice with SOAP. I have to use ws-security, so I followed this documentation: http://docs.oracle.com/cd/E15523_01/security.1111/e10037/wss.htm
I did everything in the document, and it works locally (using Netbeans JDK 1.5). But when I try to run it on the Oracle 11g database (using SQL Developer), it throws a java.lang.NoSuchMethodError on the sign method of WSSecurity. I use the same libraries at both locations (the ones mentioned in the documentation (saaj-api-1.3 and saaj-impl-1.3)).
What I found when googling is that it has to be a library issue, but I can't seem to figure out where it goes wrong. Does anybody have any idea where or how it can go wrong, or how I can find out?
The stacktrace:
java.lang.NoSuchMethodError
at oracle.security.xmlsec.wss.WSSecurity.sign(WSSecurity.java:1169)
at Discimus.generateSoapMessage(DISCIMUS:176)
The relevant code:
...
WSSecurity ws = WSSecurity.newInstance(soapEnvelope);
...
WSSignatureParams params = new WSSignatureParams(null, privateKey);
String []uris = {"#Body"};
ws.sign(uris, params, null); //Error throws here
As you can see, the stack trace seems to be missing a line: where in the sign method the error is actually thrown. Very weird, how can I get this missing line? Otherwise it's searching for a needle in a haystack.
Thanks in advance!
来源:https://stackoverflow.com/questions/19177307/oracle-web-services-security-wssecurity-sign-throws-nosuchmethoderror-how-to-f