[jira] Created: (CAMEL-987) when deal with a response header, an infinite loop occurs

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
when deal with a response header,  an  infinite loop occurs
-----------------------------------------------------------

                 Key: CAMEL-987
                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
             Project: Apache Camel
          Issue Type: Bug
    Affects Versions: 1.4.0
         Environment: operating system: windows 2000
software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
            Reporter: Sky Wang
         Attachments: camel-context.xml, sre.wsdl

I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.

I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:

@WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
@XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)

public interface SreServicePortType {

/*
 *
 */

    @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
    @WebMethod
    public void serviceContentFetchReq(
        @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
        aspire.com.xsd.ServiceContentFetchReq request,
        @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
        aspire.com.xsd.ServiceHeader requestHeader,
        @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
        javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
        @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
        javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
    );
}

Then, I implement the routing rules in the xml file:

        <process ref="ipValidateProcessor" />
        <choice>
            <when>
                 <!-- First predicate -->
                 <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
                 <to uri="cxf:bean:serviceEndpoint" />
                 <process ref="responseProcessor" />
            </when>
           <otherwise>
                  <process ref="invalidIPProcessor" />
           </otherwise>
     </choice>

In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.

So i put response body into Object[2], and put response header into Object[3]:

               org.apache.camel.Message in = exchange.getIn();
          List inBody = (List) in.getBody();
          Holder holderBody = (Holder)inBody.get(2);
          holderBody .value = body;// body is a ServiceContentFetchReqResponse object
               Holder holderHeader = (Holder)inBody.get(3);
          holderHeader .value = header;//header is a ServiceHeader object

But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
I debuged into program, there is an Infinite Loop occured at the
org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):

                for (int x = 0; x < inObjects.size(); x++) {
                    Object o = inObjects.get(x);
                    if (o instanceof Holder) {
                        outObjects.set(x + 1, o);
                    }
                }

I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.

Stack trace:

2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
严重: EXCEPTION
java.lang.OutOfMemoryError: Java heap space
2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
信息: Interceptor has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
at $Proxy48.serviceContentFetchReq(Unknown Source)
at com.aspire.archtype.camel.Client.invoke(Client.java:77)
at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
... 16 more
javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
at $Proxy48.serviceContentFetchReq(Unknown Source)
at com.aspire.archtype.camel.Client.invoke(Client.java:77)
at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
... 3 more
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col {unknown-source}]: [1,0]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
... 16 more


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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sky Wang updated CAMEL-987:
---------------------------

    Component/s: camel-cxf

I think this is a camel-cxf component bug.

> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>         Attachments: camel-context.xml, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Assigned: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reassigned CAMEL-987:
----------------------------------

    Assignee: Willem Jiang

> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>         Attachments: camel-context.xml, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46497#action_46497 ]

Willem Jiang commented on CAMEL-987:
------------------------------------

Can you show me the code of ipValidateProcessor and the other processors?
I think you may set a wrong response message in the processor.
Here is an example[1] of how to deal with the holders, please pay attentions to the below codes

{code}
        // Set the response message, first element is the return value of the operation,
        // the others are the holders of method parameters
        exchange.getOut().setBody(new Object[] {null, personId, ssn, name});
{code}

[1] http://cwiki.apache.org/CAMEL/cxf.html#CXF-HowtoconsumethemessagefromthecamelcxfendpointinPOJOdataformat

> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>         Attachments: camel-context.xml, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46661#action_46661 ]

Sky Wang commented on CAMEL-987:
--------------------------------

I'm very sorry for reply so late.I  have waited for an email notify when sombody commented on this bug, but i didn't receive anyone. And when i log in  JIRA today,  i found you have replied. Very sorry!

I hava uploaded my processors,  pls see the attachments.Thanks again!



> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>         Attachments: camel-context.xml, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sky Wang updated CAMEL-987:
---------------------------

    Attachment: processors.rar

> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>         Attachments: camel-context.xml, processors.rar, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46662#action_46662 ]

Sky Wang commented on CAMEL-987:
--------------------------------

I found i filled a mis-spelling email address,  and correct it now:)

> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>         Attachments: camel-context.xml, processors.rar, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46664#action_46664 ]

Willem Jiang commented on CAMEL-987:
------------------------------------

I saw this line in the ResponseProcess

this.setOutBody(this.getInBody());

You did not change any holder's value, can you try out the codes that I showed in my last comment.

NOTE: You need put the  return value of the method as the first array element into the out message body.




> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>         Attachments: camel-context.xml, processors.rar, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46666#action_46666 ]

Sky Wang commented on CAMEL-987:
--------------------------------

The infinite loop occurs in invalidIProcessor, and it wouldn't run in ResponseProcessor.

I try you last comment, and modified InvalidProcessor like this:

private void buildResponse() {
                //get body
                ServiceContentFetchReq req = (ServiceContentFetchReq) this.getInBody();
                ProcessorRequest request = req.getRequest();

                ServiceContentFetchReqResponse serviceResponse = new ServiceContentFetchReqResponse();
                ProcessorResponse response = new ProcessorResponse();
                response.setHret("21000000");
                response.setVersion(request.getVersion());
                response.setTransactionID(request.getTransactionID());
                serviceResponse.setReturn(response);
               
               
                ServiceHeader serviceHeader = new ServiceHeader();
                Header header = new Header();
                header.setTargetIP("10.1.3.63");
                serviceHeader.setHeader(header);
               
                org.apache.camel.Message in = exchange.getIn();
                List inBody = (List) in.getBody();
                Holder holderHeader = (Holder)inBody.get(2);
                holderHeader.value = serviceResponse;
                Holder holderValue = (Holder)inBody.get(3);
                holderValue.value = serviceHeader;
               
                this.exchange.getOut().setBody(new Object[]{inBody.get(0), inBody.get(1), holderValue, holderHeader});
       

Then it runs ok, and i would modify other processors in the same way:)






> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>         Attachments: camel-context.xml, processors.rar, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-987.
--------------------------------

    Fix Version/s: 1.5.0
       Resolution: Fixed

I just close this issue, as we have example and document to show how to set the hold response.

> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>             Fix For: 1.5.0
>
>         Attachments: camel-context.xml, processors.rar, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46694#action_46694 ]

Sky Wang commented on CAMEL-987:
--------------------------------

hello, Willem.After I walk around this trouble, I meet another trouble.
I do a pressure testing on this application with LoadRunner.

My test case is as follows:
1. loadrunner does a request
2. server receive a request, and then forward it to  IPValidateProcessor
3. IPValidateProcessor set exchange.getIn().setHeader("IP_VALIDATE_RESULT", "true");
4. do <to uri="cxf:bean:serviceEndpoint" />
5. do <process ref="responseProcessor" />
6. end

Route logic as follows, I just want to test the <when> clause:
<route>
        <from uri="cxf:bean:routerEndpoint" />
        <try>
                <process ref="ipValidateProcessor" />
                <choice>
                        <when>
                                <!-- First predicate -->
                                <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
                                <to uri="cxf:bean:serviceEndpoint" />
                                <process ref="responseProcessor" />
                        </when>
                        <otherwise>
                                <process ref="invalidIPProcessor" />
                        </otherwise>
                </choice>
                <catch>
                        <exception>com.aspire.archtype.camel.exception.AppException</exception>
                        <process ref="sreExceptionHandler"></process>
                </catch>
        </try>
</route>

When only an virtual user runs the test case once, it runs ok.
But when have 30 virtual users run for 1 minute, some of  the transactions run failure, and logic run into <otherwise> clause.I found that the in.headers.IP_VALIDATE_RESULT is null, so logic run into <otherwise>.

I don't now why, the same request, some run into <when>, some run into  <otherwith>?






> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>             Fix For: 1.5.0
>
>         Attachments: camel-context.xml, processors.rar, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46770#action_46770 ]

Willem Jiang commented on CAMEL-987:
------------------------------------

Hi Sky,

Shall we start a new thread in the mail list to discuss this issue ?
Since it does not relate to this JIRA's topic.

Willem

> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>             Fix For: 1.5.0
>
>         Attachments: camel-context.xml, processors.rar, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46771#action_46771 ]

Sky Wang commented on CAMEL-987:
--------------------------------

OK, I will fill a new JIRA to discuss.

> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>             Fix For: 1.5.0
>
>         Attachments: camel-context.xml, processors.rar, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-987) when deal with a response header, an infinite loop occurs

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-987?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46772#action_46772 ]

Sky Wang commented on CAMEL-987:
--------------------------------

I have created a new issue:
https://issues.apache.org/activemq/browse/CAMEL-1019


> when deal with a response header,  an  infinite loop occurs
> -----------------------------------------------------------
>
>                 Key: CAMEL-987
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-987
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 1.4.0
>         Environment: operating system: windows 2000
> software platform: apache-camel-1.4.0 + apache-cxf-2.1.1
>            Reporter: Sky Wang
>            Assignee: Willem Jiang
>             Fix For: 1.5.0
>
>         Attachments: camel-context.xml, processors.rar, sre.wsdl
>
>
> I use apache-camel-1.4.0 and apache-cxf-2.1.1 in my application.
> My application is a web service application.Which receive a soap header + soap body, and then response a soap header + soap body.
> I use WSDLToJava tool to create the java code from wsdl, it creates an interface for me as follow:
> @WebService(targetNamespace = "http://com.aspire/", name = "SreServicePortType")
> @XmlSeeAlso({aspire.com.xsd.ObjectFactory.class})
> @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
> public interface SreServicePortType {
> /*
>  *
>  */
>     @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
>     @WebMethod
>     public void serviceContentFetchReq(
>         @WebParam(partName = "request", name = "serviceContentFetchReq", targetNamespace = "http://com.aspire/xsd")
>         aspire.com.xsd.ServiceContentFetchReq request,
>         @WebParam(partName = "requestHeader", name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         aspire.com.xsd.ServiceHeader requestHeader,
>         @WebParam(partName = "response", mode = WebParam.Mode.OUT, name = "serviceContentFetchReqResponse", targetNamespace = "http://com.aspire/xsd")
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceContentFetchReqResponse> response,
>         @WebParam(partName = "responseHeader", mode = WebParam.Mode.OUT, name = "serviceHeader", targetNamespace = "http://com.aspire/xsd", header = true)
>         javax.xml.ws.Holder<aspire.com.xsd.ServiceHeader> responseHeader
>     );
> }
> Then, I implement the routing rules in the xml file:
>         <process ref="ipValidateProcessor" />
>         <choice>
>             <when>
>                  <!-- First predicate -->
>                  <el>${in.headers.IP_VALIDATE_RESULT == 'true'}</el>
>                  <to uri="cxf:bean:serviceEndpoint" />
>                  <process ref="responseProcessor" />
>             </when>
>            <otherwise>
>                   <process ref="invalidIPProcessor" />
>            </otherwise>
>      </choice>
> In the ipValidateProcessor,  I set  in.headers.IP_VALIDATE_RESULT = false, so the invalidIPProcessor will run.In the invalidIPProcessor,  I only need set response body and response header.
> I have traced the exchange object in the processor, the exchange.out element is null, and the exchange.in element is a CxfMessage object. The exchange.in.body element is a MessageContentList object: Object[0] is a ServiceContentFetchReq , Object[1] is a ServiceHeader, Object[2] is a Holder<T>, Object[3] is a Holder<T>.
> So i put response body into Object[2], and put response header into Object[3]:
>                org.apache.camel.Message in = exchange.getIn();
>           List inBody = (List) in.getBody();
>           Holder holderBody = (Holder)inBody.get(2);
>           holderBody .value = body;// body is a ServiceContentFetchReqResponse object
>                Holder holderHeader = (Holder)inBody.get(3);
>           holderHeader .value = header;//header is a ServiceHeader object
> But, when I run the application, I got an Exception:java.lang.OutOfMemoryError: Java heap space.
> I debuged into program, there is an Infinite Loop occured at the
> org.apache.cxf.jaxws.interceptors.HolderOutInterceptor(72):
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
> I have traced and found: inObjects == outObjects is true, which leads to an Infinite Loop.
> Stack trace:
> 2008-10-14 9:40:19 sun.reflect.NativeMethodAccessorImpl invoke0
> 严重: EXCEPTION
> java.lang.OutOfMemoryError: Java heap space
> 2008-10-14 9:40:19 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> 信息: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more
> javax.xml.ws.soap.SOAPFaultException: Error reading XMLStreamReader.
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:199)
> at $Proxy48.serviceContentFetchReq(Unknown Source)
> at com.aspire.archtype.camel.Client.invoke(Client.java:77)
> at com.aspire.archtype.camel.spring.Main.main(Main.java:19)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:183)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:54)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:449)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1996)
> at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1832)
> at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:591)
> at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:296)
> at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:242)
> at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:178)
> ... 3 more
> Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
>  at [row,col {unknown-source}]: [1,0]
> at com.ctc.wstx.sr.StreamScanner.throwUnexpectedEOF(StreamScanner.java:661)
> at com.ctc.wstx.sr.BasicStreamReader.handleEOF(BasicStreamReader.java:2134)
> at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2040)
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
> at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1095)
> at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:83)
> ... 16 more

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