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 CB6977661 for ; Mon, 21 Nov 2011 10:05:15 +0000 (UTC) Received: (qmail 75888 invoked by uid 500); 21 Nov 2011 10:05:14 -0000 Delivered-To: apmail-ws-dev-archive@ws.apache.org Received: (qmail 75407 invoked by uid 500); 21 Nov 2011 10:05:13 -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 75400 invoked by uid 99); 21 Nov 2011 10:05:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Nov 2011 10:05:13 +0000 X-ASF-Spam-Status: No, hits=-1999.9 required=5.0 tests=ALL_TRUSTED,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; Mon, 21 Nov 2011 10:05:12 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id F305993D7A for ; Mon, 21 Nov 2011 10:04:51 +0000 (UTC) Date: Mon, 21 Nov 2011 10:04:51 +0000 (UTC) From: "Colm O hEigeartaigh (Updated) (JIRA)" To: dev@ws.apache.org Message-ID: <875829054.50737.1321869892016.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 [ https://issues.apache.org/jira/browse/WSS-282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Colm O hEigeartaigh updated WSS-282: ------------------------------------ Attachment: (was: wss4j-1.6.4-SNAPSHOT.jar) > 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 > Attachments: wss4j-1.6.4-SNAPSHOT.jar, xmlsec-1.5.0-SNAPSHOT.jar > > > 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. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa 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