JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-5113

CXF: getting exception when using payload="envelope" in combination with wsdlLocation when the wsdl contains headers

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.2.6 (EE only), 3.0.0
  • Fix Version/s: 2.2.7 (EE only), 3.0.1
  • Component/s: Modules: CXF
  • Labels:
    None
  • User impact:
    High
  • Similar Issues:
    None

Description

This issue was created to track the fix for the EE-2002 issue.
This is the original comment from it:

I have tested the Mule 2.2.7 fix against one of our test services. The
service in question no longer throws a TransformerException but the
request still fails with the following exception....

WARNING: Interceptor for
{http://ctp.wcsl.com/wsdl/LottoWager-v1}LottoWagerBinding_v1_0 has
thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not write to XMLStreamWriter.
at
org.apache.cxf.interceptor.StaxOutInterceptor$StaxOutEndingInterceptor.handleMessage(StaxOutInterceptor.java:173)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
at
org.apache.cxf.phase.PhaseInterceptorChain.resume(PhaseInterceptorChain.java:218)
at
org.mule.transport.cxf.CxfServiceComponent$1.write(CxfServiceComponent.java:273)
at
org.mule.transport.http.HttpServerConnection.writeResponse(HttpServerConnection.java:315)
at
org.mule.transport.http.HttpMessageReceiver$HttpWorker.run(HttpMessageReceiver.java:191)
at org.mule.work.WorkerContext.run(WorkerContext.java:310)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.xml.stream.XMLStreamException: Trying to write
END_DOCUMENT when document has no root (ie. trying to output empty
document).
at
com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1473)
at
com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1502)
at
com.ctc.wstx.sw.BaseStreamWriter.finishDocument(BaseStreamWriter.java:1663)
at
com.ctc.wstx.sw.BaseStreamWriter.writeEndDocument(BaseStreamWriter.java:585)
at
org.apache.cxf.interceptor.StaxOutInterceptor$StaxOutEndingInterceptor.handleMessage(StaxOutInterceptor.java:163)
... 9 more

I have attached a copy of the console log, an export of the Mule project
and an example soap request. The service I have switched over to use the
cxf:inbound-endpoint wsdlLocation attribute is called
WHS_LottoWagerStub-v1 - the endpoint address is
http://localhost:8888/whs/LottoWager-v1.

Let me know if you require any further details.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Pablo Kraan added a comment - 28/Sep/10 04:48 PM

The problem has the same cause that the original MULE-5030 issue, which I think is a bug in CXF.

The root of the problem is in SoapBindingFactory.initializeMessage() method. There CXF
creates a MessageInfo and sets the different message parts inside a list. Each part has an index,
which is the same than its position in the list. Then CXF removes the "headers" parts of the list but
it does not updates the index of the remaining parts. In this case, removes the first part (index 0)
but it does not updates the index of the second part (from 1 to 0).

The problem is manifested inside AbstractOutDatabindingInterceptor.writeParts method:

for (MessagePartInfo part : parts) {
    if (objs.hasValue(part)) {
            Object o = objs.get(part);
            dataWriter.write(o, part, xmlWriter);
    }
 }

The problem is in the call to objs.hasValue(part):

public boolean hasValue(MessagePartInfo key) {
    if (key.getIndex() >= size()) {
            return false;
    }
    return super.get(key.getIndex()) != REMOVED_MARKER;
}

This call return false because key.getIndex() = 1 and size =1. (key.getIndex() should be 0)

I will try to find a workaround for this problem, but I think the right fix should be in CXF,
which should update the part's index everytime it removes a part from the list.

Show
Pablo Kraan added a comment - 28/Sep/10 04:48 PM The problem has the same cause that the original MULE-5030 issue, which I think is a bug in CXF. The root of the problem is in SoapBindingFactory.initializeMessage() method. There CXF creates a MessageInfo and sets the different message parts inside a list. Each part has an index, which is the same than its position in the list. Then CXF removes the "headers" parts of the list but it does not updates the index of the remaining parts. In this case, removes the first part (index 0) but it does not updates the index of the second part (from 1 to 0). The problem is manifested inside AbstractOutDatabindingInterceptor.writeParts method:
for (MessagePartInfo part : parts) {
    if (objs.hasValue(part)) {
            Object o = objs.get(part);
            dataWriter.write(o, part, xmlWriter);
    }
 }
The problem is in the call to objs.hasValue(part):
public boolean hasValue(MessagePartInfo key) {
    if (key.getIndex() >= size()) {
            return false;
    }
    return super.get(key.getIndex()) != REMOVED_MARKER;
}
This call return false because key.getIndex() = 1 and size =1. (key.getIndex() should be 0) I will try to find a workaround for this problem, but I think the right fix should be in CXF, which should update the part's index everytime it removes a part from the list.
Pablo Kraan
29/Sep/10 10:14 AM
View full commit
MULE-5113: CXF - getting exception when using payload=envelope in combination with wsdlLocation when the wsdl contains headers git-svn-id: https://svn.codehaus.org/mule/branches/mule-2.2.x@19768 bf997673-6b11-0410-b953-e057580c5b09
mule-2.2.x
+7
-
tests/integration/src/test/java/org/mule/test/integration/transport/cxf/CxfAndXslTransformerOnSoapTestCase.java
+2
-1
tests/integration/src/test/resources/org/mule/test/integration/transport/cxf/scratchcard-service-v1.xml
+72
-3
transports/cxf/src/main/java/org/mule/transport/cxf/support/OutputPayloadInterceptor.java
+47
-
transports/cxf/src/test/java/org/mule/transport/cxf/support/OutputPayloadInterceptorTestCase.java
Hide
Permalink
Pablo Kraan added a comment - 29/Sep/10 12:37 PM - edited

Many thanks to Dan Diephouse who has helped a lot with suggestions about how to fix the problem

Fix 2.2.x
http://fisheye.codehaus.org/changelog/mule/?cs=19768
http://fisheye.codehaus.org/changelog/mule/?cs=19805

Fix 3.0.x
http://fisheye.codehaus.org/changelog/mule/?cs=19806

Fix 3.x
http://fisheye.codehaus.org/changelog/mule/?cs=19809

Show
Pablo Kraan added a comment - 29/Sep/10 12:37 PM - edited Many thanks to Dan Diephouse who has helped a lot with suggestions about how to fix the problem Fix 2.2.x http://fisheye.codehaus.org/changelog/mule/?cs=19768 http://fisheye.codehaus.org/changelog/mule/?cs=19805 Fix 3.0.x http://fisheye.codehaus.org/changelog/mule/?cs=19806 Fix 3.x http://fisheye.codehaus.org/changelog/mule/?cs=19809
Pablo Kraan
30/Sep/10 10:33 AM
View full commit
Recorded merge of revisions 19790 via svnmerge from https://svn.codehaus.org/mule/branches/mule-3.0.x ................ r19790 | pablo.kraan | 2010-09-30 11:41:30 -0300 (Thu, 30 Sep 2010) | 13 lines Recorded merge of revisions 19768,19789 via svnmerge from https://svn.codehaus.org/mule/branches/mule-2.2.x ........ r19768 | pablo.kraan | 2010-09-29 12:14:52 -0300 (Wed, 29 Sep 2010) | 1 line MULE-5113: CXF - getting exception when using payload=envelope in combination with wsdlLocation when the wsdl contains headers ........ r19789 | pablo.kraan | 2010-09-30 11:25:15 -0300 (Thu, 30 Sep 2010) | 1 line Revert: MULE-5116: Multicast problems on AIX ........ ................ git-svn-id: https://svn.codehaus.org/mule/branches/mule-3.x@19791 bf997673-6b11-0410-b953-e057580c5b09
3.1.x
Pablo Kraan
01/Oct/10 11:50 AM
View full commit
MULE-5113: CXF - getting exception when using payload=envelope in combination with wsdlLocation when the wsdl contains headers (adding new integration test) git-svn-id: https://svn.codehaus.org/mule/branches/mule-2.2.x@19805 bf997673-6b11-0410-b953-e057580c5b09
mule-2.2.x
-
-7
tests/integration/src/test/java/org/mule/test/integration/transport/cxf/CxfAndXslTransformerOnSoapTestCase.java
Added
tests/integration/src/test/java/org/mule/test/integration/transport/cxf/CxfEnvelopePayloadWithWsdlTestCase.java
Added
tests/integration/src/test/resources/org/mule/test/integration/transport/cxf/scratchcard-service-config.xml
+1
-2
tests/integration/src/test/resources/org/mule/test/integration/transport/cxf/scratchcard-service-v1.xml
Pablo Kraan
02/Oct/10 10:41 AM
View full commit
Merged revisions 19806 via svnmerge from https://svn.codehaus.org/mule/branches/mule-3.0.x ................ r19806 | pablo.kraan | 2010-10-01 15:30:41 -0300 (Fri, 01 Oct 2010) | 13 lines Merged revisions 19768,19805 via svnmerge from https://svn.codehaus.org/mule/branches/mule-2.2.x ........ r19768 | pablo.kraan | 2010-09-29 12:14:52 -0300 (Wed, 29 Sep 2010) | 1 line MULE-5113: CXF - getting exception when using payload=envelope in combination with wsdlLocation when the wsdl contains headers ........ r19805 | pablo.kraan | 2010-10-01 13:50:51 -0300 (Fri, 01 Oct 2010) | 1 line MULE-5113: CXF - getting exception when using payload=envelope in combination with wsdlLocation when the wsdl contains headers (adding new integration test) ........ ................ git-svn-id: https://svn.codehaus.org/mule/branches/mule-3.x@19809 bf997673-6b11-0410-b953-e057580c5b09
3.1.x
+72
-3
modules/cxf/src/main/java/org/mule/module/cxf/support/OutputPayloadInterceptor.java
+47
-
modules/cxf/src/test/java/org/mule/module/cxf/support/OutputPayloadInterceptorTestCase.java
Added
tests/integration/src/test/java/org/mule/test/integration/transport/cxf/CxfEnvelopePayloadWithWsdlTestCase.java
Added
tests/integration/src/test/resources/org/mule/test/integration/transport/cxf/scratchcard-service-config.xml
Pablo Kraan made changes - 02/Oct/10 10:46 AM
Field Original Value New Value
Priority To be reviewed [ 6 ] Critical [ 2 ]
Pablo Kraan made changes - 02/Oct/10 10:47 AM
Status Open [ 1 ] In Progress [ 3 ]
Pablo Kraan made changes - 02/Oct/10 10:47 AM
Status In Progress [ 3 ] Closed [ 6 ]
Fix Version/s 2.2.7 (EE only) [ 10876 ]
Fix Version/s 3.0.1 [ 10877 ]
Resolution Fixed [ 1 ]
Pablo Kraan made changes - 02/Oct/10 10:48 AM
Link This issue blocks EE-2002 [ EE-2002 ]
Daniel Feist
23/Nov/10 11:56 AM
View full commit
Recorded merge of revisions 19394,19399,19626,19684,19717,19743,19768,19786,19789,19794,19805,19812,19859,19992,19995 via svnmerge from https://svn.codehaus.org/mule/branches/mule-2.2.x ........ r19394 | esteban.robles | 2010-09-07 12:44:08 -0300 (Tue, 07 Sep 2010) | 4 lines EE-1991: spring:ref not supported in some cases - Support for spring:ref tag - Extension to Mule's parsing - Add example of use in CXF ........ r19399 | dzapata | 2010-09-07 16:46:20 -0300 (Tue, 07 Sep 2010) | 1 line added info for MULE-4771 in the readme ........ r19626 | esteban.robles | 2010-09-13 11:04:56 -0300 (Mon, 13 Sep 2010) | 2 lines EE-1966: IMAPS transport to read a message but if filters applied then mark the email un read or NOT SEEN - Handle automatic SEEN flag ........ r19684 | esteban.robles | 2010-09-20 11:59:06 -0300 (Mon, 20 Sep 2010) | 3 lines EE-2019: Servlet transport consumes POST Body and therefore shows null for @FormParam parameter - Add cached http servlet request - Extend schema to make it optional ........ r19717 | esteban.robles | 2010-09-24 15:01:05 -0300 (Fri, 24 Sep 2010) | 3 lines EE-2035: using quartz over ftp to read a file does not delete a file from the src directory - Add new job - Add disabling of native polling ........ r19743 | epere4 | 2010-09-27 12:57:05 -0300 (Mon, 27 Sep 2010) | 2 lines MULE-5106 Embedded Mule under TC Server - Throws Exception getJavaPID Implementing getWrapperPID() and getJavaPID() because they are not present on wrapper-3.2.0 (the version that TC Server uses for Windows 32bit) ........ r19768 | pablo.kraan | 2010-09-29 12:14:52 -0300 (Wed, 29 Sep 2010) | 1 line MULE-5113: CXF - getting exception when using payload=envelope in combination with wsdlLocation when the wsdl contains headers ........ r19786 | pablo.kraan | 2010-09-29 17:52:12 -0300 (Wed, 29 Sep 2010) | 1 line MULE-5116: Multicast problems on AIX ........ r19789 | pablo.kraan | 2010-09-30 11:25:15 -0300 (Thu, 30 Sep 2010) | 1 line Revert: MULE-5116: Multicast problems on AIX ........ r19794 | pablo.kraan | 2010-09-30 14:18:46 -0300 (Thu, 30 Sep 2010) | 1 line MULE-5116: Multicast problems on AIX (Fixed adding java.net.preferIPv4Stack=true property in wrapper.conf files) ........ r19805 | pablo.kraan | 2010-10-01 13:50:51 -0300 (Fri, 01 Oct 2010) | 1 line MULE-5113: CXF - getting exception when using payload=envelope in combination with wsdlLocation when the wsdl contains headers (adding new integration test) ........ r19812 | esteban.robles | 2010-10-04 10:19:30 -0300 (Mon, 04 Oct 2010) | 2 lines EE-2042: Authentication failure with HttpBasicAuthenticationFilter does not set the WWW-Authenticate header - Change exception handling as Security Manager is throwing an UnauthorisedException ........ r19859 | dirk.olmes | 2010-10-07 09:24:07 -0300 (Thu, 07 Oct 2010) | 1 line give the test some love ........ r19992 | dirk.olmes | 2010-10-22 07:44:27 -0300 (Fri, 22 Oct 2010) | 1 line MULE-4959 (FtpConnectionFactory does not properly validate connections) ........ r19995 | dirk.olmes | 2010-10-22 19:52:03 -0300 (Fri, 22 Oct 2010) | 1 line MULE-5120 (MessageContext is not being set on WebServiceContext) ........ git-svn-id: https://svn.codehaus.org/mule/branches/mule-3.x@20307 bf997673-6b11-0410-b953-e057580c5b09
3.1.x
Pablo Kraan made changes - 27/Dec/10 01:25 PM
Link This issue blocks EE-1828 [ EE-1828 ]
Transition Time In Source Status Execution Times Last Executer Last Execution Date
Open Open In Progress In Progress
3d 18h 1 Pablo Kraan 02/Oct/10 10:47 AM
In Progress In Progress Closed Closed
41s 1 Pablo Kraan 02/Oct/10 10:47 AM
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
  • Repository mule on http://foo.bar/ failed: Error in remote call to 'FishEye 0 (http://foo.bar/)' (http://foo.bar) [AbstractRestCommand{path='/rest-service-fe/changeset-v1/listChangesets/', params={expand=changesets[-21:-1].revisions[0:29], comment=MULE-5113, p4JobFixed=MULE-5113, rep=mule}, methodType=GET}] : java.net.UnknownHostException: foo.bar

People

  • Assignee:
    Pablo Kraan
    Reporter:
    Pablo Kraan
Vote (0)
Watch (0)

Dates

  • Created:
    28/Sep/10 04:46 PM
    Updated:
    27/Dec/10 01:25 PM
    Resolved:
    02/Oct/10 10:47 AM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.