ws-wss4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricuzzo <>
Subject Re: Help Error using WSS4j
Date Thu, 15 Jul 2010 12:23:29 GMT

Hi, Although it is an old post, i wanted to help solving this problem for
all Java Developers dont waste their time as much as i did. I founda couple
of the multiple reasons this error can happend, i  got solved.
I use Weblogic 8.1 and Java 1.4. For some reasons I think if works fine for
java 1.6 (maybe because some changes in the '=' operator in java 1.6). All
the problems have the same root, 'it cannot read the resource/config.xml'
file in the xmlsec.jar

1) First. Make sure you have permissions in your com.puter for reading doc.s
inside the java project. The problem is in, not in WSS4J. You
can find inside the jar the following code:

InputStream is = (InputStream) AccessController.doPrivileged(
new PrivilegedAction() {
	public Object run() {
	String cfile =
	return getClass().getResourceAsStream(cfile != null ? cfile :

So make sure you have the priviledges for getting access to the config.xml

2) This one you gonna love it: The version xmlsec-1.4.3 and 1.4.1 ( dont
know in 1.3 too) have a bug, a very big bug, wich prevents you from reading
the file config.xml, in wich all the algoritms and java classes for
encrypting are specified.
Thebug is in  this Class:;

In the code they compared two strings with the '=' operator, and not the
equals(), check this bugged code in the jar src:

public boolean isNamespaceElement(Node el, String type, String ns) {
		if ((el == null) ||
	¡¡¡¡Comparing strings with the != operator!!!!! -->
         ns!=el.getNamespaceURI() || !el.getLocalName().equals(type)){
		   return false;

		return true;

 Just change it: ns!=el.getNamespaceURI()   --> 

It will probably make your code work.

Hope it helps. Good luck.

View this message in context:
Sent from the WSS4J mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message