ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Tadman (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (WSS-273) org.apache.ws.security.transform.STRTransform causes ClassCastException when wss4j is running on IBM 1.6 JVM
Date Mon, 02 May 2011 04:24:03 GMT

    [ https://issues.apache.org/jira/browse/WSS-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13027537#comment-13027537
] 

Jeremy Tadman edited comment on WSS-273 at 5/2/11 4:22 AM:
-----------------------------------------------------------

Actually Pär-Johan's approach *does* solve the problem. But only as long as these calls are
done before the signing process is started. Rather than doing that I had modified the implementation
of WSSConfig.init() (naughty, I know). This caused it to fail in the above manner, but only
the first time a token was generated. After that it worked. Perhaps WSSConfig.init() is called
a little later than it is needed?

Unfortunately, there is another exception which I am getting after restarting the application
(without restarting the server). 

I am investigating what the difference is between executions.

[Edit: Was missing some of the stacktrace which would be relevant]

[5/2/11 14:18:27:221 EST] 00000028 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/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.apache.ws.security.saml.WSSecSignatureSAML.computeSignature(WSSecSignatureSAML.java:530)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:155)
...  Spring stuff ....
	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/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.springframework.webflow.engine.State.enter(State.java:194)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.springframework.webflow.engine.Flow.start(Flow.java:535)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:366)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:225)
at org.apache.ws.security.saml.WSSecSignatureSAML.computeSignature(WSSecSignatureSAML.java:530)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.springframework.webflow.executor.FlowExecutorImpl.launchExecution(FlowExecutorImpl.java:140)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:155)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:193)
... spring stuff ...
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R Caused by: 
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 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
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3933)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at org.jcp.xml.dsig.internal.dom.DOMReference.transform(Unknown Source)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:445)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMReference.digest(Unknown
Source)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:504)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.digestReference(Unknown
Source)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:301)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(Unknown
Source)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:275)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.apache.ws.security.saml.WSSecSignatureSAML.computeSignature(WSSecSignatureSAML.java:525)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	... 66 more
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R Caused by: 
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 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	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:267)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.apache.ws.security.transform.STRTransform.transform(STRTransform.java:122)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMTransform.transform(Unknown
Source)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	... 71 more
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R Caused by: 
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R javax.xml.crypto.dsig.TransformException:
java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMSubTreeData incompatible with
javax.xml.crypto.OctetStreamDataCaused 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/2/11 14:18:27:221 EST] 00000027 SystemErr     R 
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:163)
at org.jcp.xml.dsig.internal.dom.DOMReference.transform(Unknown Source)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R 	... 73 more
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMReference.digest(Unknown
Source)
[5/2/11 14:18:27:221 EST] 00000028 SystemErr     R Caused by: 
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.digestReference(Unknown
Source)java.lang.ClassCastException: org.jcp.xml.dsig.internal.dom.DOMSubTreeData incompatible
with javax.xml.crypto.OctetStreamData
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(Unknown
Source)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at org.apache.ws.security.saml.WSSecSignatureSAML.computeSignature(WSSecSignatureSAML.java:525)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	... 66 more	at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:161)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R Caused by: 
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 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	... 73 more
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:267)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at org.apache.ws.security.transform.STRTransform.transform(STRTransform.java:122)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMTransform.transform(Unknown
Source)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	... 71 more
[5/2/11 14:18:27:221 EST] 00000027 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/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:163)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	... 73 more
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R Caused by: java.lang.ClassCastException:
org.jcp.xml.dsig.internal.dom.DOMSubTreeData incompatible with javax.xml.crypto.OctetStreamData
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:161)
[5/2/11 14:18:27:221 EST] 00000027 SystemErr     R 	... 73 more


      was (Author: jtadman):
    Actually Pär-Johan's approach *does* solve the problem. But only as long as these calls
are done before the signing process is started. Rather than doing that I had modified the
implementation of WSSConfig.init() (naughty, I know). This caused it to fail in the above
manner, but only the first time a token was generated. After that it worked. Perhaps WSSConfig.init()
is called a little later than it is needed?

Unfortunately, there is another exception which I am getting after restarting the application
(without restarting the server). 

I am investigating what the difference is between executions.

[5/2/11 13:14:33:828 EST] 0000001f 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/2/11 13:14:33:828 EST] 0000001f SystemErr     R 	at org.apache.ws.security.saml.WSSecSignatureSAML.computeSignature(WSSecSignatureSAML.java:530)
[5/2/11 13:14:33:828 EST] 0000001f SystemErr     R 	at org.apache.ws.security.saml.WSSecSignatureSAML.build(WSSecSignatureSAML.java:155)

..... spring stuff....

[5/2/11 13:14:33:844 EST] 0000001f 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/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMReference.transform(Unknown
Source)
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMReference.digest(Unknown
Source)
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.digestReference(Unknown
Source)
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(Unknown
Source)
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	at org.apache.ws.security.saml.WSSecSignatureSAML.computeSignature(WSSecSignatureSAML.java:525)
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	... 64 more
[5/2/11 13:14:33:844 EST] 0000001f 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/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:267)
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	at org.apache.ws.security.transform.STRTransform.transform(STRTransform.java:122)
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	at org.jcp.xml.dsig.internal.dom.DOMTransform.transform(Unknown
Source)
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	... 69 more
[5/2/11 13:14:33:844 EST] 0000001f 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/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:163)
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	... 71 more
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R Caused by: java.lang.ClassCastException:
org.jcp.xml.dsig.internal.dom.DOMSubTreeData incompatible with javax.xml.crypto.OctetStreamData
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	at org.apache.ws.security.transform.STRTransform.transformIt(STRTransform.java:161)
[5/2/11 13:14:33:844 EST] 0000001f SystemErr     R 	... 71 more
  
> org.apache.ws.security.transform.STRTransform causes ClassCastException when wss4j is
running on IBM 1.6 JVM 
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: WSS-273
>                 URL: https://issues.apache.org/jira/browse/WSS-273
>             Project: WSS4J
>          Issue Type: Bug
>          Components: WSS4J Core
>    Affects Versions: 1.6
>         Environment: Windows XP, IBM 1.6 JVM
>            Reporter: Pär-Johan Lif
>            Assignee: Colm O hEigeartaigh
>
> I have tried to use wss4j1.6 (alpha version) on IBM's 1.6 JVM. It works fine, except
for when we are getting a SOAP-message where an STRTransform is used.
> Then we get the following exception below.  (I should mention that it works on SUN's
1.6 JVM).
> java.lang.ClassCastException: org.apache.ws.security.transform.STRTransform incompatible
with com.ibm.xml.crypto.dsig.dom.transform.TransformBase
> 	at com.ibm.xml.crypto.dsig.dom.Unmarshalling.unmarshalTransform(Unmarshalling.java:446)
> 	at com.ibm.xml.crypto.dsig.dom.Unmarshalling.unmarshalTransforms(Unmarshalling.java:422)
> 	at com.ibm.xml.crypto.dsig.dom.Unmarshalling.unmarshalReference(Unmarshalling.java:358)
> 	at com.ibm.xml.crypto.dsig.dom.Unmarshalling.unmarshalSignedInfo(Unmarshalling.java:272)
> 	at com.ibm.xml.crypto.dsig.dom.Unmarshalling.unmarshalSignature(Unmarshalling.java:196)
> 	at com.ibm.xml.crypto.dsig.dom.Unmarshalling.unmarshal(Unmarshalling.java:96)
> 	at com.ibm.xml.crypto.dsig.dom.FactoryImpl.unmarshalXMLSignature(FactoryImpl.java:217)
> 	at org.apache.ws.security.processor.SignatureProcessor.verifyXMLSignature(SignatureProcessor.java:323)
> 	at org.apache.ws.security.processor.SignatureProcessor.handleToken(SignatureProcessor.java:165)
> 	at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:303)
> 	at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:231)
> 	at org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityEngine.java:185)

--
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


Mime
View raw message