[
https://issues.apache.org/jira/browse/CXF-6991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tomohisa Igarashi updated CXF-6991:
-----------------------------------
Attachment: cxf-ws-rm-context-property.tgz
Attaching a unit test [^cxf-ws-rm-context-property.tgz].
It has 2 test method, test() and testContextProperty(). test() uses
GreeterCombinedClient which has ws-security properties on its definition. On
the other hand the testContextProperty() uses GreeterCombinedClientNoProperty
which doesn't have properties, but they are passed as request context
properties instead. You'll see following error only in testContextProperty().
test() finishes without this error.
{code}
2016-08-04 17:49:56.891 SEVERE [org.apache.cxf.ws.rm.Proxy] Failed to send RM
protocol message
{http://schemas.xmlsoap.org/ws/2005/02/rm}SequenceAcknowledgement.
(org.apache.cxf.ws.rm.Proxy invoke)
org.apache.cxf.interceptor.Fault: Security configuration could not be detected.
Potential cause: Make sure jaxws:client element with name attribute value
matching endpoint port is defined as well as a ws-security.signature.properties
element within it.
at
org.apache.cxf.ws.security.wss4j.policyhandlers.AsymmetricBindingHandler.doSignBeforeEncrypt(AsymmetricBindingHandler.java:198)
(...snip...)
Caused by: org.apache.cxf.ws.policy.PolicyException: Security configuration
could not be detected. Potential cause: Make sure jaxws:client element with
name attribute value matching endpoint port is defined as well as a
ws-security.signature.properties element within it.
at
org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.policyNotAsserted(AbstractBindingBuilder.java:315)
{code}
It's not exactly same error though, looks similar as both can't find the
properties passed in as request context properties when it's sending subsequent
WS-RM protocol message (SequenceAcknowledgement in the unit test). Since both
of TerminateSequence and SequenceAcknowledgement are sent by background thread,
I guess something wrong happens while transferring context between those
threads.
> 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
> 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)