From dev-return-11336-apmail-ws-dev-archive=ws.apache.org@ws.apache.org Fri Jun 3 16:20:33 2011 Return-Path: X-Original-To: apmail-ws-dev-archive@www.apache.org Delivered-To: apmail-ws-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A4FEF6DC0 for ; Fri, 3 Jun 2011 16:20:33 +0000 (UTC) Received: (qmail 74524 invoked by uid 500); 3 Jun 2011 16:20:33 -0000 Delivered-To: apmail-ws-dev-archive@ws.apache.org Received: (qmail 74258 invoked by uid 500); 3 Jun 2011 16:20:32 -0000 Mailing-List: contact dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ws.apache.org Delivered-To: mailing list dev@ws.apache.org Received: (qmail 74249 invoked by uid 99); 3 Jun 2011 16:20:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 16:20:32 +0000 X-ASF-Spam-Status: No, hits=-1998.7 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD,URI_HEX X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 16:20:28 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4F518F23D3 for ; Fri, 3 Jun 2011 16:19:47 +0000 (UTC) Date: Fri, 3 Jun 2011 16:19:47 +0000 (UTC) From: "Colm O hEigeartaigh (JIRA)" To: dev@ws.apache.org Message-ID: <861535566.66147.1307117987321.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <252215645.21079.1304493843162.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (WSS-282) STRTransform JCE provider throws java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMSubTreeData incompatible with javax.xml.crypto.OctetStreamData in Websphere MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/WSS-282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Colm O hEigeartaigh updated WSS-282: ------------------------------------ Fix Version/s: (was: 1.6.1) > STRTransform JCE provider throws java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMSubTreeData incompatible with javax.xml.crypto.OctetStreamData in Websphere > ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: WSS-282 > URL: https://issues.apache.org/jira/browse/WSS-282 > Project: WSS4J > Issue Type: Bug > Components: WSS4J Core > Affects Versions: 1.6 > Environment: WebSphere 7.0.0.15 > Reporter: Jeremy Tadman > Assignee: Colm O hEigeartaigh > > When using WSS4J to generate signed sender-vouches SAML tokens involving an STRTransform I get the below exception (right at the end). It only happens when there are multiple applications using WSS4J or the application is restarted. > Seems to be related to the fact that the STRTransformProvider is added to WebSphere's JCE provider list using Security.addProvider(provider) but is loaded using the WAR module's classloader. When an app is restarted, this classloader hangs around and causes issues because org.jcp.xml.dsig.internal.dom.DOMSubTreeData loaded by the new module instance's classloader is not considered an instance of the org.jcp.xml.dsig.internal.dom.DOMSubTreeData class loaded by the STRTransform instance. I tested this by modifying the source code and printing out which classloader had loaded the class. In the case where things work (first startup of the first application to use WSS4J) the classloaders are the same. In cases where things don't work the classloader of the DOMSubTreeData instance passed into the transform is different to the classloader of the DOMSubTreeData class itself. Similar result when trying from one application then another. > This seems loosely related to https://issues.apache.org/jira/browse/WSS-82 and http://bouncy-castle.1462172.n4.nabble.com/Bug-in-Cipher-class-td1465452.html. > Seems there are problems running custom JCE providers on WebSphere (and IBM say they don't support custom JCE providers). > Adding WSS4j to a higher level classloader causes all kinds of other errors to come up. > Is there any way we can get this to work or are we WebSphere users out of luck? (Or am I just doing something horrible wrong?). I've already applied the fixes shown in https://issues.apache.org/jira/browse/WSS-273 (I got those errors before I got this one). > [5/4/11 16:41:04:379 EST] 00000029 SystemErr R org.apache.ws.security.WSSecurityException: Signature creation failed; nested exception is: > javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.dsig.TransformException: javax.xml.crypto.dsig.TransformException: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMSubTreeData incompatible with javax.xml.crypto.OctetStreamData > [5/4/11 16:41:04:379 EST] 00000029 SystemErr R at org.apache.ws.security.saml.WSSecSignatureSAML.computeSignature(WSSecSignatureSAML.java:529) > [5/4/11 16:41:04:379 EST] 00000029 SystemErr R at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:155) > ... servlet stack trace components .... > [5/4/11 16:41:04:392 EST] 00000029 SystemErr R Caused by: javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.dsig.TransformException: javax.xml.crypto.dsig.TransformException: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMSubTreeData incompatible with javax.xml.crypto.OctetStreamData > [5/4/11 16:41:04:393 EST] 00000029 SystemErr R at org.jcp.xml.dsig.internal.dom.DOMReference.transform(DOMReference.java:412) > [5/4/11 16:41:04:393 EST] 00000029 SystemErr R at org.jcp.xml.dsig.internal.dom.DOMReference.digest(DOMReference.java:304) > [5/4/11 16:41:04:393 EST] 00000029 SystemErr R at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.digestReference(DOMXMLSignature.java:467) > [5/4/11 16:41:04:393 EST] 00000029 SystemErr R at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:361) > [5/4/11 16:41:04:393 EST] 00000029 SystemErr R at org.apache.ws.security.saml.WSSecSignatureSAML.computeSignature(WSSecSignatureSAML.java:524) > [5/4/11 16:41:04:393 EST] 00000029 SystemErr R ... 66 more > [5/4/11 16:41:04:394 EST] 00000029 SystemErr R Caused by: javax.xml.crypto.dsig.TransformException: javax.xml.crypto.dsig.TransformException: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMSubTreeData incompatible with javax.xml.crypto.OctetStreamData > [5/4/11 16:41:04:394 EST] 00000029 SystemErr R at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:267) > [5/4/11 16:41:04:394 EST] 00000029 SystemErr R at org.apache.ws.security.transform.STRTransform.transform(STRTransform.java:122) > [5/4/11 16:41:04:395 EST] 00000029 SystemErr R at org.jcp.xml.dsig.internal.dom.DOMTransform.transform(DOMTransform.java:147) > [5/4/11 16:41:04:395 EST] 00000029 SystemErr R at org.jcp.xml.dsig.internal.dom.DOMReference.transform(DOMReference.java:409) > [5/4/11 16:41:04:395 EST] 00000029 SystemErr R ... 70 more > [5/4/11 16:41:04:395 EST] 00000029 SystemErr R Caused by: javax.xml.crypto.dsig.TransformException: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMSubTreeData incompatible with javax.xml.crypto.OctetStreamData > [5/4/11 16:41:04:395 EST] 00000029 SystemErr R at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:163) > [5/4/11 16:41:04:396 EST] 00000029 SystemErr R ... 73 more > [5/4/11 16:41:04:396 EST] 00000029 SystemErr R Caused by: java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMSubTreeData incompatible with javax.xml.crypto.OctetStreamData > [5/4/11 16:41:04:397 EST] 00000029 SystemErr R at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:160) > [5/4/11 16:41:04:397 EST] 00000029 SystemErr R ... 73 more -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org For additional commands, e-mail: dev-help@ws.apache.org