[ 
https://issues.apache.org/jira/browse/TUSCANY-1541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12521011
 ] 

Sunny Ip commented on TUSCANY-1541:
-----------------------------------

We have found the line that causes this exception, in the invokeTarget() method 
of Axis2BindingInvoker:

    protected Object invokeTarget(final Object payload, final 
ConversationSequence sequence, String conversationId)
        throws InvocationTargetException {
        try {

            Object[] args = (Object[])payload;
            OperationClient operationClient = createOperationClient(args, 
conversationId);

            // ensure connections are tracked so that they can be closed by the 
reference binding
            MessageContext requestMC = 
operationClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
            requestMC.getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, 
Boolean.TRUE);
            requestMC.getOptions().setTimeOutInMilliSeconds(120000L);

            operationClient.execute(true);

            MessageContext responseMC = 
operationClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);

            operationClient.complete(requestMC);

            return responseMC.getEnvelope().getBody().getFirstElement();

        } catch (AxisFault e) {
            throw new InvocationTargetException(e);
        }
    }

The culprit is the operation.complete() method being called too early before 
the message is fully loaded. If I do a responseMC.getEnvelope().toString() 
before the complete, everything works fine. Without that change, long complex 
XML messages trigger the exception. 

> XMLStreamException in when calling XMLHelper.load() with a large XML
> --------------------------------------------------------------------
>
>                 Key: TUSCANY-1541
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1541
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Problem Determination
>    Affects Versions: Java-SDO-Next
>         Environment: Tomcat
>            Reporter: Sunny Ip
>            Priority: Critical
>             Fix For: Java-SDO-Next
>
>
> When XMLHelper.load() is called with a very long XML string, OMStAXWrapper 
> throws an XMLStreamException. I get this problem when I'm receiving a WS 
> response with an SDO object containing a collection of records, leading to a 
> TransformationException when databinding. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to