You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by liugang594 Liu <cl...@gmail.com> on 2013/05/29 05:36:34 UTC

NullPointerException throws from CXF Component (DataFormat is CXF_MESSAGE) when handle fault response

If the required service with ws-addressing enable, and from CXF component
(dataFormat type is CXF_MESSAGE) sent a request msg without ws-addressing
information inside. then got a NullPointerException, the error msg is:

Exception in thread "default-workqueue-1" java.lang.NullPointerException
at
org.apache.camel.component.cxf.DefaultCxfBinding.getContentFromCxf(DefaultCxfBinding.java:642)
at
org.apache.camel.component.cxf.DefaultCxfBinding.populateExchangeFromCxfResponse(DefaultCxfBinding.java:151)
at
org.apache.camel.component.cxf.CxfClientCallback.handleException(CxfClientCallback.java:81)
at
org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:59)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1132)
at
org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at
org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
at java.lang.Thread.run(Thread.java:722)



The expect msg looks like:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<soap:Fault>
<faultcode xmlns:ns1="http://www.w3.org/2005/08/addressing
">ns1:MessageAddressingHeaderRequired</faultcode>
<faultstring>A required header representing a Message Addressing Property
is not present</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>


is it a bug of Camel?

-- 
Thanks
GangLiu
MSN: liugang_0011@hotmail.com
Skype: gang.liu.talendbj

Re: NullPointerException throws from CXF Component (DataFormat is CXF_MESSAGE) when handle fault response

Posted by liugang594 Liu <cl...@gmail.com>.
It's easy to reproduce this problem:

use CXF component with CXF_MESSAGE dataFormat to call any service, and the
response of this service is a fault, then you can see this exception.

My camel version is 2.10.4, and cxf version is 2.7.5


2013/5/29 Willem jiang <wi...@gmail.com>

> From the stack trace I can tell there are something when camel-cxf wants
> to read the content from CXF message.
> Can you show me the whole Camel route and your camel version?
>
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
> On Wednesday, May 29, 2013 at 11:36 AM, liugang594 Liu wrote:
>
> > If the required service with ws-addressing enable, and from CXF component
> > (dataFormat type is CXF_MESSAGE) sent a request msg without ws-addressing
> > information inside. then got a NullPointerException, the error msg is:
> >
> > Exception in thread "default-workqueue-1" java.lang.NullPointerException
> > at
> >
> org.apache.camel.component.cxf.DefaultCxfBinding.getContentFromCxf(DefaultCxfBinding.java:642)
> > at
> >
> org.apache.camel.component.cxf.DefaultCxfBinding.populateExchangeFromCxfResponse(DefaultCxfBinding.java:151)
> > at
> >
> org.apache.camel.component.cxf.CxfClientCallback.handleException(CxfClientCallback.java:81)
> > at
> >
> org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:59)
> > at
> >
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1132)
> > at
> >
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> > at
> >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> > at
> >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> > at
> >
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> > at java.lang.Thread.run(Thread.java:722)
> >
> >
> >
> > The expect msg looks like:
> >
> > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > <soap:Header/>
> > <soap:Body>
> > <soap:Fault>
> > <faultcode xmlns:ns1="http://www.w3.org/2005/08/addressing
> > ">ns1:MessageAddressingHeaderRequired</faultcode>
> > <faultstring>A required header representing a Message Addressing Property
> > is not present</faultstring>
> > </soap:Fault>
> > </soap:Body>
> > </soap:Envelope>
> >
> >
> > is it a bug of Camel?
> >
> > --
> > Thanks
> > GangLiu
> > MSN: liugang_0011@hotmail.com (mailto:liugang_0011@hotmail.com)
> > Skype: gang.liu.talendbj
>
>
>
>


-- 
Thanks
GangLiu
MSN: liugang_0011@hotmail.com
Skype: gang.liu.talendbj

Re: NullPointerException throws from CXF Component (DataFormat is CXF_MESSAGE) when handle fault response

Posted by Willem jiang <wi...@gmail.com>.
From the stack trace I can tell there are something when camel-cxf wants to read the content from CXF message.
Can you show me the whole Camel route and your camel version?


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem




On Wednesday, May 29, 2013 at 11:36 AM, liugang594 Liu wrote:

> If the required service with ws-addressing enable, and from CXF component
> (dataFormat type is CXF_MESSAGE) sent a request msg without ws-addressing
> information inside. then got a NullPointerException, the error msg is:
>  
> Exception in thread "default-workqueue-1" java.lang.NullPointerException
> at
> org.apache.camel.component.cxf.DefaultCxfBinding.getContentFromCxf(DefaultCxfBinding.java:642)
> at
> org.apache.camel.component.cxf.DefaultCxfBinding.populateExchangeFromCxfResponse(DefaultCxfBinding.java:151)
> at
> org.apache.camel.component.cxf.CxfClientCallback.handleException(CxfClientCallback.java:81)
> at
> org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:59)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1132)
> at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> at java.lang.Thread.run(Thread.java:722)
>  
>  
>  
> The expect msg looks like:
>  
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Header/>
> <soap:Body>
> <soap:Fault>
> <faultcode xmlns:ns1="http://www.w3.org/2005/08/addressing
> ">ns1:MessageAddressingHeaderRequired</faultcode>
> <faultstring>A required header representing a Message Addressing Property
> is not present</faultstring>
> </soap:Fault>
> </soap:Body>
> </soap:Envelope>
>  
>  
> is it a bug of Camel?
>  
> --  
> Thanks
> GangLiu
> MSN: liugang_0011@hotmail.com (mailto:liugang_0011@hotmail.com)
> Skype: gang.liu.talendbj




Re: NullPointerException throws from CXF Component (DataFormat is CXF_MESSAGE) when handle fault response

Posted by liugang594 Liu <cl...@gmail.com>.
OK, let me send you an example, wait a moment. and BTW, seems RAW also has
problem.


2013/5/30 Willem jiang <wi...@gmail.com>

> It could save me some time if you can provide a simple test case for it.
>
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
>
> On Thursday, May 30, 2013 at 9:51 AM, liugang594 Liu wrote:
>
> > Sorry to bothering you again, I'd like to know is there any progress on
> > this issue? and I saw one bug is created related to it
> > https://issues.apache.org/jira/browse/CAMEL-6404 .
> >
> > Thanks.
> >
> >
> > 2013/5/29 liugang594 Liu <clevers594@gmail.com (mailto:
> clevers594@gmail.com)>
> >
> > > If the required service with ws-addressing enable, and from CXF
> component
> > > (dataFormat type is CXF_MESSAGE) sent a request msg without
> ws-addressing
> > > information inside. then got a NullPointerException, the error msg is:
> > >
> > > Exception in thread "default-workqueue-1"
> java.lang.NullPointerException
> > > at
> > >
> org.apache.camel.component.cxf.DefaultCxfBinding.getContentFromCxf(DefaultCxfBinding.java:642)
> > > at
> > >
> org.apache.camel.component.cxf.DefaultCxfBinding.populateExchangeFromCxfResponse(DefaultCxfBinding.java:151)
> > > at
> > >
> org.apache.camel.component.cxf.CxfClientCallback.handleException(CxfClientCallback.java:81)
> > > at
> > >
> org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:59)
> > > at
> > >
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1132)
> > > at
> > >
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> > > at
> > >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> > > at
> > >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> > > at
> > >
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> > > at java.lang.Thread.run(Thread.java:722)
> > >
> > >
> > >
> > > The expect msg looks like:
> > >
> > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > > <soap:Header/>
> > > <soap:Body>
> > > <soap:Fault>
> > > <faultcode xmlns:ns1="http://www.w3.org/2005/08/addressing
> > > ">ns1:MessageAddressingHeaderRequired</faultcode>
> > > <faultstring>A required header representing a Message Addressing
> > > Property is not present</faultstring>
> > > </soap:Fault>
> > > </soap:Body>
> > > </soap:Envelope>
> > >
> > >
> > > is it a bug of Camel?
> > >
> > > --
> > > Thanks
> > > GangLiu
> > > MSN: liugang_0011@hotmail.com (mailto:liugang_0011@hotmail.com)
> > > Skype: gang.liu.talendbj
> >
> >
> >
> >
> > --
> > Thanks
> > GangLiu
> > MSN: liugang_0011@hotmail.com (mailto:liugang_0011@hotmail.com)
> > Skype: gang.liu.talendbj
>
>
>
>


-- 
Thanks
GangLiu
MSN: liugang_0011@hotmail.com
Skype: gang.liu.talendbj

Re: NullPointerException throws from CXF Component (DataFormat is CXF_MESSAGE) when handle fault response

Posted by liugang594 Liu <cl...@gmail.com>.
Hi Willem:

I created an example, see attachment.

Free free to contact me if you need more.

Thanks.
GangLiu


2013/5/30 Willem jiang <wi...@gmail.com>

> It could save me some time if you can provide a simple test case for it.
>
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
>
> On Thursday, May 30, 2013 at 9:51 AM, liugang594 Liu wrote:
>
> > Sorry to bothering you again, I'd like to know is there any progress on
> > this issue? and I saw one bug is created related to it
> > https://issues.apache.org/jira/browse/CAMEL-6404 .
> >
> > Thanks.
> >
> >
> > 2013/5/29 liugang594 Liu <clevers594@gmail.com (mailto:
> clevers594@gmail.com)>
> >
> > > If the required service with ws-addressing enable, and from CXF
> component
> > > (dataFormat type is CXF_MESSAGE) sent a request msg without
> ws-addressing
> > > information inside. then got a NullPointerException, the error msg is:
> > >
> > > Exception in thread "default-workqueue-1"
> java.lang.NullPointerException
> > > at
> > >
> org.apache.camel.component.cxf.DefaultCxfBinding.getContentFromCxf(DefaultCxfBinding.java:642)
> > > at
> > >
> org.apache.camel.component.cxf.DefaultCxfBinding.populateExchangeFromCxfResponse(DefaultCxfBinding.java:151)
> > > at
> > >
> org.apache.camel.component.cxf.CxfClientCallback.handleException(CxfClientCallback.java:81)
> > > at
> > >
> org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:59)
> > > at
> > >
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1132)
> > > at
> > >
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> > > at
> > >
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> > > at
> > >
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> > > at
> > >
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> > > at java.lang.Thread.run(Thread.java:722)
> > >
> > >
> > >
> > > The expect msg looks like:
> > >
> > > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > > <soap:Header/>
> > > <soap:Body>
> > > <soap:Fault>
> > > <faultcode xmlns:ns1="http://www.w3.org/2005/08/addressing
> > > ">ns1:MessageAddressingHeaderRequired</faultcode>
> > > <faultstring>A required header representing a Message Addressing
> > > Property is not present</faultstring>
> > > </soap:Fault>
> > > </soap:Body>
> > > </soap:Envelope>
> > >
> > >
> > > is it a bug of Camel?
> > >
> > > --
> > > Thanks
> > > GangLiu
> > > MSN: liugang_0011@hotmail.com (mailto:liugang_0011@hotmail.com)
> > > Skype: gang.liu.talendbj
> >
> >
> >
> >
> > --
> > Thanks
> > GangLiu
> > MSN: liugang_0011@hotmail.com (mailto:liugang_0011@hotmail.com)
> > Skype: gang.liu.talendbj
>
>
>
>


-- 
Thanks
GangLiu
MSN: liugang_0011@hotmail.com
Skype: gang.liu.talendbj

Re: NullPointerException throws from CXF Component (DataFormat is CXF_MESSAGE) when handle fault response

Posted by Willem jiang <wi...@gmail.com>.
It could save me some time if you can provide a simple test case for it.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, May 30, 2013 at 9:51 AM, liugang594 Liu wrote:

> Sorry to bothering you again, I'd like to know is there any progress on
> this issue? and I saw one bug is created related to it
> https://issues.apache.org/jira/browse/CAMEL-6404 .
>  
> Thanks.
>  
>  
> 2013/5/29 liugang594 Liu <clevers594@gmail.com (mailto:clevers594@gmail.com)>
>  
> > If the required service with ws-addressing enable, and from CXF component
> > (dataFormat type is CXF_MESSAGE) sent a request msg without ws-addressing
> > information inside. then got a NullPointerException, the error msg is:
> >  
> > Exception in thread "default-workqueue-1" java.lang.NullPointerException
> > at
> > org.apache.camel.component.cxf.DefaultCxfBinding.getContentFromCxf(DefaultCxfBinding.java:642)
> > at
> > org.apache.camel.component.cxf.DefaultCxfBinding.populateExchangeFromCxfResponse(DefaultCxfBinding.java:151)
> > at
> > org.apache.camel.component.cxf.CxfClientCallback.handleException(CxfClientCallback.java:81)
> > at
> > org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:59)
> > at
> > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1132)
> > at
> > org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> > at
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> > at
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> > at
> > org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
> > at java.lang.Thread.run(Thread.java:722)
> >  
> >  
> >  
> > The expect msg looks like:
> >  
> > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > <soap:Header/>
> > <soap:Body>
> > <soap:Fault>
> > <faultcode xmlns:ns1="http://www.w3.org/2005/08/addressing
> > ">ns1:MessageAddressingHeaderRequired</faultcode>
> > <faultstring>A required header representing a Message Addressing
> > Property is not present</faultstring>
> > </soap:Fault>
> > </soap:Body>
> > </soap:Envelope>
> >  
> >  
> > is it a bug of Camel?
> >  
> > --
> > Thanks
> > GangLiu
> > MSN: liugang_0011@hotmail.com (mailto:liugang_0011@hotmail.com)
> > Skype: gang.liu.talendbj
>  
>  
>  
>  
> --  
> Thanks
> GangLiu
> MSN: liugang_0011@hotmail.com (mailto:liugang_0011@hotmail.com)
> Skype: gang.liu.talendbj




Re: NullPointerException throws from CXF Component (DataFormat is CXF_MESSAGE) when handle fault response

Posted by liugang594 Liu <cl...@gmail.com>.
Sorry to bothering you again, I'd like to know is there any progress on
this issue? and I saw one bug is created related to it
https://issues.apache.org/jira/browse/CAMEL-6404 .

Thanks.


2013/5/29 liugang594 Liu <cl...@gmail.com>

> If the required service with ws-addressing enable, and from CXF component
> (dataFormat type is CXF_MESSAGE) sent a request msg without ws-addressing
> information inside. then got a NullPointerException, the error msg is:
>
> Exception in thread "default-workqueue-1" java.lang.NullPointerException
> at
> org.apache.camel.component.cxf.DefaultCxfBinding.getContentFromCxf(DefaultCxfBinding.java:642)
>  at
> org.apache.camel.component.cxf.DefaultCxfBinding.populateExchangeFromCxfResponse(DefaultCxfBinding.java:151)
> at
> org.apache.camel.component.cxf.CxfClientCallback.handleException(CxfClientCallback.java:81)
>  at
> org.apache.cxf.interceptor.ClientOutFaultObserver.onMessage(ClientOutFaultObserver.java:59)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1132)
>  at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>  at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
>  at java.lang.Thread.run(Thread.java:722)
>
>
>
> The expect msg looks like:
>
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Header/>
>  <soap:Body>
> <soap:Fault>
> <faultcode xmlns:ns1="http://www.w3.org/2005/08/addressing
> ">ns1:MessageAddressingHeaderRequired</faultcode>
>  <faultstring>A required header representing a Message Addressing
> Property is not present</faultstring>
> </soap:Fault>
>  </soap:Body>
> </soap:Envelope>
>
>
> is it a bug of Camel?
>
> --
> Thanks
> GangLiu
> MSN: liugang_0011@hotmail.com
> Skype: gang.liu.talendbj
>
>


-- 
Thanks
GangLiu
MSN: liugang_0011@hotmail.com
Skype: gang.liu.talendbj