You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by MARTELLI Julien <jm...@softwaymedical.fr> on 2011/05/13 15:21:20 UTC

Splitted server response

Hi folks,

I recently developed a custom input interceptor for one of my CXF-base Web Service client.
His job is to extract the content of the server response in order to save it through the persistence layer.
It is attached to the RECEIVE Phase.

My problem is the following :

An exception is raised when I try to extract the response content, the exception is :

392906 [http-8080-Processor2] WARN org.apache.cxf.phase.PhaseInterceptorChain  - Interceptor for {urn:ihe:iti:xds-b:2007}DocumentRepository_Service#{urn:ihe:iti:xds-b:2007}DocumentRepository_ProvideAndRegisterDocumentSet-b has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Couldn't find MIME boundary: --uuid:443a543d-4ab6-448c-bcb9-3bf01d2c2c3c
      at org.apache.cxf.interceptor.AttachmentInInterceptor.handleMessage(AttachmentInInterceptor.java:66)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:729)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2261)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2134)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1988)
      at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:47)
      at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188)
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639)
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265)
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
      ...

Caused by: java.io.IOException: Couldn't find MIME boundary: --uuid:443a543d-4ab6-448c-bcb9-3bf01d2c2c3c
      at org.apache.cxf.attachment.AttachmentDeserializer.initializeRootMessage(AttachmentDeserializer.java:122)
      at org.apache.cxf.attachment.AttachmentDeserializer.initializeAttachments(AttachmentDeserializer.java:91)
      at org.apache.cxf.interceptor.AttachmentInInterceptor.handleMessage(AttachmentInInterceptor.java:64)
      ... 56 more

And this is clearly linked to this new interceptor as without it it works.


After debugging for a while I noticed something strange : my In interceptor is actually called twice.
This could maybe explain why this exception is raised.
I retrieved the content of the returned message in order to check if there is a difference between the two calls. The only difference is that on the second call I have an extra propertie : exchange.finished = true.

Seems that the response is sent several < packets >... Is this something normal ?

Thanks in advance for your help.

RE: Splitted server response

Posted by MARTELLI Julien <jm...@softwaymedical.fr>.
Hello, thanks for your answer.

I figured out yesterday night, it was actually due to an error on my code.

Sorry about that.

-----Message d'origine-----
De : Daniel Kulp [mailto:dkulp@apache.org] 
Envoyé : mercredi 18 mai 2011 22:50
À : users@cxf.apache.org
Cc : MARTELLI Julien
Objet : Re: Splitted server response

On Friday, May 13, 2011 9:21:20 AM MARTELLI Julien wrote:
> Hi folks,
> 
> I recently developed a custom input interceptor for one of my CXF-base Web
> Service client. His job is to extract the content of the server response
> in order to save it through the persistence layer. It is attached to the
> RECEIVE Phase.

Honestly, I have no idea unless your interceptor is somehow messing with the 
bytes of the stream.    If you could create an example test case, we might be 
able to look at it better.

Dan



> 
> My problem is the following :
> 
> An exception is raised when I try to extract the response content, the
> exception is :
> 
> 392906 [http-8080-Processor2] WARN
> org.apache.cxf.phase.PhaseInterceptorChain  - Interceptor for
> {urn:ihe:iti:xds-b:2007}DocumentRepository_Service#{urn:ihe:iti:xds-b:2007
> }DocumentRepository_ProvideAndRegisterDocumentSet-b has thrown exception,
> unwinding now org.apache.cxf.interceptor.Fault: Couldn't find MIME
> boundary: --uuid:443a543d-4ab6-448c-bcb9-3bf01d2c2c3c at
> org.apache.cxf.interceptor.AttachmentInInterceptor.handleMessage(Attachmen
> tInInterceptor.java:66) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha
> in.java:244) at
> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:729) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespon
> seInternal(HTTPConduit.java:2261) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespon
> se(HTTPConduit.java:2134) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPCo
> nduit.java:1988) at
> org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputS
> tream.java:47) at
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188) at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639) at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInt
> erceptor.handleMessage(MessageSenderInterceptor.java:62) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha
> in.java:244) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> ...
> 
> Caused by: java.io.IOException: Couldn't find MIME boundary:
> --uuid:443a543d-4ab6-448c-bcb9-3bf01d2c2c3c at
> org.apache.cxf.attachment.AttachmentDeserializer.initializeRootMessage(Att
> achmentDeserializer.java:122) at
> org.apache.cxf.attachment.AttachmentDeserializer.initializeAttachments(Att
> achmentDeserializer.java:91) at
> org.apache.cxf.interceptor.AttachmentInInterceptor.handleMessage(Attachmen
> tInInterceptor.java:64) ... 56 more
> 
> And this is clearly linked to this new interceptor as without it it works.
> 
> 
> After debugging for a while I noticed something strange : my In interceptor
> is actually called twice. This could maybe explain why this exception is
> raised.
> I retrieved the content of the returned message in order to check if there
> is a difference between the two calls. The only difference is that on the
> second call I have an extra propertie : exchange.finished = true.
> 
> Seems that the response is sent several < packets >... Is this something
> normal ?
> 
> Thanks in advance for your help.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: Splitted server response

Posted by Daniel Kulp <dk...@apache.org>.
On Friday, May 13, 2011 9:21:20 AM MARTELLI Julien wrote:
> Hi folks,
> 
> I recently developed a custom input interceptor for one of my CXF-base Web
> Service client. His job is to extract the content of the server response
> in order to save it through the persistence layer. It is attached to the
> RECEIVE Phase.

Honestly, I have no idea unless your interceptor is somehow messing with the 
bytes of the stream.    If you could create an example test case, we might be 
able to look at it better.

Dan



> 
> My problem is the following :
> 
> An exception is raised when I try to extract the response content, the
> exception is :
> 
> 392906 [http-8080-Processor2] WARN
> org.apache.cxf.phase.PhaseInterceptorChain  - Interceptor for
> {urn:ihe:iti:xds-b:2007}DocumentRepository_Service#{urn:ihe:iti:xds-b:2007
> }DocumentRepository_ProvideAndRegisterDocumentSet-b has thrown exception,
> unwinding now org.apache.cxf.interceptor.Fault: Couldn't find MIME
> boundary: --uuid:443a543d-4ab6-448c-bcb9-3bf01d2c2c3c at
> org.apache.cxf.interceptor.AttachmentInInterceptor.handleMessage(Attachmen
> tInInterceptor.java:66) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha
> in.java:244) at
> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:729) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespon
> seInternal(HTTPConduit.java:2261) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespon
> se(HTTPConduit.java:2134) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPCo
> nduit.java:1988) at
> org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputS
> tream.java:47) at
> org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188) at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66) at
> org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:639) at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInt
> erceptor.handleMessage(MessageSenderInterceptor.java:62) at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCha
> in.java:244) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:516) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313) at
> org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:265) at
> org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73) at
> org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> ...
> 
> Caused by: java.io.IOException: Couldn't find MIME boundary:
> --uuid:443a543d-4ab6-448c-bcb9-3bf01d2c2c3c at
> org.apache.cxf.attachment.AttachmentDeserializer.initializeRootMessage(Att
> achmentDeserializer.java:122) at
> org.apache.cxf.attachment.AttachmentDeserializer.initializeAttachments(Att
> achmentDeserializer.java:91) at
> org.apache.cxf.interceptor.AttachmentInInterceptor.handleMessage(Attachmen
> tInInterceptor.java:64) ... 56 more
> 
> And this is clearly linked to this new interceptor as without it it works.
> 
> 
> After debugging for a while I noticed something strange : my In interceptor
> is actually called twice. This could maybe explain why this exception is
> raised.
> I retrieved the content of the returned message in order to check if there
> is a difference between the two calls. The only difference is that on the
> second call I have an extra propertie : exchange.finished = true.
> 
> Seems that the response is sent several < packets >... Is this something
> normal ?
> 
> Thanks in advance for your help.

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com