You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by "Pradhan, Priyatosh (MLX Technology)" <pr...@ml.com> on 2009/08/11 18:07:06 UTC

Help Error using WSS4j

Hi,

Can you please help me resolve this issue:

I am trying to sign a SOAP request using X.509 cert and and consume a
web service as a client. But getting an error 'Unknown transformation.
No handler installed for URI http://www.w3.org/2001/10/xml-exc-c14n#'.

Attaching the classpath snap and deploy config file:


<?xml version="1.0" encoding="UTF-8"?>
<deployment name="defaultClientConfig"
            xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 <globalConfiguration>
   <parameter name="disablePrettyXML" value="true"/>
   <parameter name="enableNamespacePrefixOptimization" value="false"/>
  <requestFlow>
   <handler name="DoSecuritySender"
type="java:org.apache.ws.axis.security.WSDoAllSender" >
   <parameter name="user" value="wsseccert"/>
   <parameter name="passwordCallbackClass" value="com.
portal.PWCallback"/> 
    <parameter name="signaturePropFile" value="crypto.properties" />
    <parameter name="action" value="Signature"/>
    <parameter name="signatureKeyIdentifier" value="DirectReference" /> 
    <!-- <parameter name="signatureKeyIdentifier"
value="X509KeyIdentifier" /> -->
   </handler>
  </requestFlow>
  <!-- <responseFlow>
   <handler name="DoSecurityReceiver"
type="java:org.apache.ws.axis.security.WSDoAllReceiver">
    <parameter name="signaturePropFile" value="crypto.properties" />
    <parameter name="action" value="Signature"/>
   </handler>
  </responseFlow> -->
  </globalConfiguration>
 <transport name="http"
pivot="java:org.apache.axis.transport.http.HTTPSender"/>
 <transport name="local"
pivot="java:org.apache.axis.transport.local.LocalSender"/>
 <transport name="java"
pivot="java:org.apache.axis.transport.java.JavaSender"/>
</deployment>


 <<Picture (Device Independent Bitmap)>> 




I am getting below error:

org.apache.ws.security.WSSecurityException: Error during Signature: ;
nested exception is: 
	org.apache.ws.security.WSSecurityException: Signature creation
failed (Cannot setup signature data structure); nested exception is: 
	org.apache.xml.security.transforms.TransformationException:
Unknown transformation. No handler installed for URI
http://www.w3.org/2001/10/xml-exc-c14n#
Original Exception was
org.apache.xml.security.transforms.InvalidTransformException: Unknown
transformation. No handler installed for URI
http://www.w3.org/2001/10/xml-exc-c14n#
	at
org.apache.ws.security.action.SignatureAction.execute(SignatureAction.ja
va:60)


Caused by: org.apache.xml.security.transforms.TransformationException:
Unknown transformation. No handler installed for URI
http://www.w3.org/2001/10/xml-exc-c14n#
Original Exception was
org.apache.xml.security.transforms.InvalidTransformException: Unknown
transformation. No handler installed for URI
http://www.w3.org/2001/10/xml-exc-c14n#
	at
org.apache.xml.security.transforms.Transforms.addTransform(Unknown
Source)
	at
org.apache.ws.security.message.WSSecSignature.addReferencesToSign(WSSecS
ignature.java:594)
	... 18 more

--------------------------------------------------------------------------
This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. References to "Merrill Lynch" are references to any company in the Merrill Lynch & Co., Inc. group of companies, which are wholly-owned by Bank of America Corporation. Securities and Insurance Products: * Are Not FDIC Insured * Are Not Bank Guaranteed * May Lose Value * Are Not a Bank Deposit * Are Not a Condition to Any Banking Service or Activity * Are Not Insured by Any Federal Government Agency. Attachments that are part of this E-communication may have additional important disclosures and disclaimers, which you should read. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing.
--------------------------------------------------------------------------
 

Snapshots released from 1_5_x-fixes branch

Posted by David Valeri <dv...@apache.org>.
I have a fix or two in the 1.5.x fixes branch and will need to submit patches for a couple more over the next couple weeks.  Right now, there is no published snapshot of this branch in a public repository (at least not that I can find).  Would it be possible to have this branch release a snapshot on a regular basis?  I have users of my code that do not share a common repository which makes distributing up-to-date snapshot builds problematic.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


Re: Help Error using WSS4j

Posted by Colm O hEigeartaigh <co...@apache.org>.
Hi,

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

This is not a bug. The namespaces are assumed to be interned, which is
what most DOM parsers do, and so checking strings for equality using
"==" should work fine. This may change in a future (major) release of
XML Security, as we/they should possibly default to a more robust
solution.

Colm.

On Thu, Jul 15, 2010 at 1:23 PM, Ricuzzo <ri...@gmail.com> wrote:
>
>
> 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 xmlsec.java, not in WSS4J. You
> can find inside the jar the following code:
> Class: org.apache.xml.security.Init;
>
> InputStream is = (InputStream) AccessController.doPrivileged(
> new PrivilegedAction() {
>        public Object run() {
>        String cfile =
> System.getProperty("org.apache.xml.security.resource.config");
>        return getClass().getResourceAsStream(cfile != null ? cfile :
> "resource/config.xml");
>                                                                                                    }
>        });
>
> 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: org.apache.xml.security.utils.ElementCheckerImpl;
>
> 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()   -->
> !ns.equals(el.getNamespaceURI())
>
> It will probably make your code work.
>
> Hope it helps. Good luck.
>
>
> --
> View this message in context: http://old.nabble.com/Help-Error-using-WSS4j-tp24920678p29172291.html
> Sent from the WSS4J mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: wss4j-dev-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


Re: Help Error using WSS4j

Posted by Ricuzzo <ri...@gmail.com>.

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 xmlsec.java, not in WSS4J. You
can find inside the jar the following code:
Class: org.apache.xml.security.Init;

InputStream is = (InputStream) AccessController.doPrivileged(
new PrivilegedAction() {
	public Object run() {
	String cfile =
System.getProperty("org.apache.xml.security.resource.config");
	return getClass().getResourceAsStream(cfile != null ? cfile :
"resource/config.xml");
												    }
	});

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: org.apache.xml.security.utils.ElementCheckerImpl;

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()   --> 
!ns.equals(el.getNamespaceURI()) 

It will probably make your code work.

Hope it helps. Good luck.


-- 
View this message in context: http://old.nabble.com/Help-Error-using-WSS4j-tp24920678p29172291.html
Sent from the WSS4J mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org