Details
Description
Hi,
I can reproduce the issue in our code, but will probably struggle to
create a test case.
I have narrowed down the culprit (in 2.6.1) to org.apache.cxf.endpoint.ClientImpl line 636
The method protected Object[] processResult(Message message,
Exchange exchange,
BindingOperationInfo oi,
Map<String, Object> resContext)
throws Exception {
And the code:
if (LOG.isLoggable(Level.FINE))
{ LOG.fine("set responseContext to be" + resContext); }The code to add all the properties from the message to resContext, creates a recursive reference, because the message already has a reference to resContext. This causes the logging to fail as when it tries to serialise the content of the map, it gets a stack overflow.
The org.apache.cxf.invocation.context contains the ResponseContext and
the ResponseContext contains the org.apache.cxf.invocation.context
To prove my hypothesis I added the following code to replace the log call:
HashMap contextMap = (HashMap)
resContext.get("org.apache.cxf.invocation.context");
HashMap responseContextMap = (HashMap)
contextMap.get("ResponseContext");
HashMap secondContextMap = (HashMap)
responseContextMap.get("org.apache.cxf.invocation.context");
if (secondContextMap != null)
And I got the Oh boy here is the error! message back.
The original stack trace is:
java.lang.StackOverflowError
at java.util.HashMap$EntrySet.iterator(HashMap.java:950)
at java.util.AbstractMap.toString(AbstractMap.java:478)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at java.util.AbstractMap.toString(AbstractMap.java:490)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at java.util.AbstractMap.toString(AbstractMap.java:490)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at java.util.AbstractMap.toString(AbstractMap.java:490)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at java.util.AbstractMap.toString(AbstractMap.java:490)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at java.util.AbstractMap.toString(AbstractMap.java:490)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at java.util.AbstractMap.toString(AbstractMap.java:490)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at java.util.AbstractMap.toString(AbstractMap.java:490)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at java.util.AbstractMap.toString(AbstractMap.java:490)
at java.lang.String.valueOf(String.java:2826)
at java.lang.StringBuilder.append(StringBuilder.java:115)
at java.util.AbstractMap.toString(AbstractMap.java:490)
<snip>