You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Freeman Fang (JIRA)" <ji...@apache.org> on 2016/08/09 08:25:20 UTC

[jira] [Commented] (CXF-6991) WS-RM - Request context properties are lost when sending subsequent protocol message

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

Freeman Fang commented on CXF-6991:
-----------------------------------

Hi Tomohisa,

To make the testContextProperty work, you just need add one line.
{code}
client.getEndpoint().getEndpointInfo().getProperties().putAll(requestContext);
{code}

so that the requestContext would be copyed into the SoapMessage created by the RMClient later on. I don't think this is a bug in CXF, just the way how you can use the CXF api to manipulate the requestContext, could you please change camel-cxf producer accordingly?

Cheers
Freeman

> WS-RM - Request context properties are lost when sending subsequent protocol message
> ------------------------------------------------------------------------------------
>
>                 Key: CXF-6991
>                 URL: https://issues.apache.org/jira/browse/CXF-6991
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 2.7.18, 3.1.7
>            Reporter: Tomohisa Igarashi
>            Assignee: Freeman Fang
>         Attachments: cxf-ws-rm-context-property.tgz
>
>
> We hit "No SAML CallbackHandler available" error when it's sending TerminateSequence.
> {code}
> 20:44:32,416 SEVERE [org.apache.cxf.ws.rm.Proxy] (default-workqueue-1) Failed to send RM protocol message {http://schemas.xmlsoap.org/ws/2005/02/rm}TerminateSequence.: org.apache.cxf.interceptor.Fault: No SAML CallbackHandler available
> 	at org.apache.cxf.ws.security.wss4j.policyhandlers.AsymmetricBindingHandler.doSignBeforeEncrypt(AsymmetricBindingHandler.java:198) [cxf-rt-ws-security-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.security.wss4j.policyhandlers.AsymmetricBindingHandler.handleBinding(AsymmetricBindingHandler.java:98) [cxf-rt-ws-security-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$PolicyBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.java:176) [cxf-rt-ws-security-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.security.wss4j.PolicyBasedWSS4JOutInterceptor$PolicyBasedWSS4JOutInterceptorInternal.handleMessage(PolicyBasedWSS4JOutInterceptor.java:90) [cxf-rt-ws-security-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272) [cxf-api-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:572) [cxf-api-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481) [cxf-api-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:393) [cxf-api-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.rm.Proxy.invoke(Proxy.java:295) [cxf-rt-ws-rm-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.rm.Proxy.terminate(Proxy.java:101) [cxf-rt-ws-rm-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.rm.SourceSequence.setAcknowledged(SourceSequence.java:159) [cxf-rt-ws-rm-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.rm.RMInInterceptor.processAcknowledgments(RMInInterceptor.java:191) [cxf-rt-ws-rm-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.rm.RMInInterceptor.handle(RMInInterceptor.java:163) [cxf-rt-ws-rm-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.rm.AbstractRMInterceptor.handleMessage(AbstractRMInterceptor.java:83) [cxf-rt-ws-rm-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272) [cxf-api-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:831) [cxf-api-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1642) [cxf-rt-transports-http-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1133) [cxf-rt-transports-http-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428) [cxf-api-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_101]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_101]
> 	at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353) [cxf-api-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_101]
> Caused by: org.apache.cxf.ws.policy.PolicyException: No SAML CallbackHandler available
> 	at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.policyNotAsserted(AbstractBindingBuilder.java:315) [cxf-rt-ws-security-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.addSamlToken(AbstractBindingBuilder.java:923) [cxf-rt-ws-security-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.handleSupportingTokens(AbstractBindingBuilder.java:571) [cxf-rt-ws-security-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.handleSupportingTokens(AbstractBindingBuilder.java:455) [cxf-rt-ws-security-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.addSupportingTokens(AbstractBindingBuilder.java:2139) [cxf-rt-ws-security-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	at org.apache.cxf.ws.security.wss4j.policyhandlers.AsymmetricBindingHandler.doSignBeforeEncrypt(AsymmetricBindingHandler.java:144) [cxf-rt-ws-security-2.7.18.redhat-1.jar:2.7.18.redhat-1]
> 	... 22 more
> {code}
> This is strange as CreateSequence and application message are successfully sent prior to this. It seems like the ws-security.* properties are lost when sending TerminateSequence while it's available for CreateSequence. Note that we pass those ws-security.* properties as request context property passed into org.apache.cxf.endpoint.Client.invoke() as a parameter using camel-cxf producer.
> I'll attach a unit test soon.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)