LocalConduit with DirectDispatch does not work with interceptors that decorate
the OutputStream
-----------------------------------------------------------------------------------------------
Key: CXF-3253
URL: https://issues.apache.org/jira/browse/CXF-3253
Project: CXF
Issue Type: Bug
Components: Transports
Affects Versions: 2.3.1, 2.2.10
Environment: Found in CXF 2.2.10, confirmed the code is the same in
2.3.1
Windows 2003 Server x64
Reporter: Sven Zethelius
Create a Client that uses the local transport.
Set property org.apache.cxf.transport.local.LocalConduit.directDispatch
Add an Out interceptor to the Client that decorates the OutputStream. For
example GZIPOutInterceptor.
Expected:
decorated OutputStream to work.
Actual:
ClassCastException
Cause:
{code:title=org.apache.cxf.transport.local.LocalConduit.dispatchDirect(Message)}
CachedOutputStream stream =
(CachedOutputStream)message.getContent(OutputStream.class);
{code}
This code is assuming the message OutputStream hasn't been wrapped. My
suggested fix would be to store the CachedContentStream you need to manipulate
as a property of the Message, in addition to the setContent, so that even if
the setContent is manipulated the other property would still be available.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.