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

Colm O hEigeartaigh commented on CXF-7214:
------------------------------------------

 
The NPE comes from MessageSenderInterceptor calling prepare() on the result of 
getConduit() without a null check. getConduit() returns null when the exchange 
has no conduit and the destination's getBackChannel() also returns null.
 
On current code, rewriting an anonymous ReplyTo in an interceptor now behaves 
differently depending on where the interceptor runs:
* *After MAPAggregator (PRE_LOGICAL):* the routing decision has already been 
made on the anonymous address, so the response goes back on the original HTTP 
back channel. Only the wsa:To of the response picks up the new URI. No NPE, but 
the response is not sent to the new address. To change where the response goes, 
the ReplyTo has to be rewritten before MAPAggregator runs (e.g. after MAPCodec 
in PRE_PROTOCOL).
* *Before MAPAggregator, decoupled responses disabled (the default):* 
non-anonymous ReplyTo addresses are now off unless 
\{{org.apache.cxf.ws.addressing.decoupled.enabled=true}} is set, and are 
limited by \{{org.apache.cxf.ws.addressing.decoupled.allowedSchemes}}. You get 
a DestinationUnreachable SOAP fault instead of an NPE.
* *Before MAPAggregator, decoupled responses enabled:* if no back-channel 
conduit can be created for the address (e.g. the transport for an allowed 
scheme isn't on the classpath), the NPE could still happen.
 
I've changed MessageSenderInterceptor to throw a Fault ("Could not send 
Message: no conduit or back channel is available for the exchange.") instead of 
an NPE when there is no conduit, with a new unit test 
(MessageSenderInterceptorTest):
 
https://github.com/apache/cxf/pull/3576
 

> Login  Register  Changing reply-to causes NPE in MessageSenderInterceptor.java
> ------------------------------------------------------------------------------
>
>                 Key: CXF-7214
>                 URL: https://issues.apache.org/jira/browse/CXF-7214
>             Project: CXF
>          Issue Type: Bug
>          Components: WS-* Components
>    Affects Versions: 3.1.9
>         Environment: java 1.8 , Spring Boot 1.4.0 , WIndows 10
>            Reporter: Jackson Thompson
>            Assignee: Colm O hEigeartaigh
>            Priority: Major
>         Attachments: pom.xml, src.zip
>
>
> I am changing the reply-to in an interceptor when I get an anonymous 
> reply-to. When I do, I get an NPE at MessageSenderInterceptor.java:46. If I 
> replace the wsa:reply-to header in the test request it responses correctly. I 
> can pull the map latter in the can and the reply-to header is set to my new 
> uri.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to