Oracle Web Services Security: WSSecurity sign throws NoSuchMethodError. How to find library issue

女生的网名这么多〃 提交于 2019-12-11 18:37:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!