You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ED Barwani <ed...@gmail.com> on 2012/05/09 07:45:39 UTC

Help with a Karaf/Camel/Cxf/ActiveMQ setup that results in an NPE

Hello,

I have a camel route that looks like:
 <camel:route>
   <camel:from uri="cxf:bean:AddressSearchEndpoint?dataFormat=PAYLOAD" />

   <camel:to uri="xslt:transforms/request.xsl" />
   <camel:log message="Transformed Request: ${body}" loggingLevel="DEBUG" />

   <camel:to uri="activemq:queue:{{msh.request}}" />

   <camel:to uri="xslt:transforms/response.xsl" />
   <camel:log message="Transformed Response: ${body}" loggingLevel="DEBUG" />
 </camel:route>

This route works desirably when I run it using the camel maven plugin
"mvn camel:run". However, when I run it in the karaf container I get a
NullPointerException

2012-05-09 11:26:40,108 | WARN  | tp1202105401-632 |
Soap11FaultOutInterceptor        |  -  -  | Error writing to
XMLStreamWriter.
javax.xml.stream.XMLStreamException: Trying to output second root, <soap:Fault>
       at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1524)[122:woodstox-core-asl:4.1.2]
       at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1531)[122:woodstox-core-asl:4.1.2]
       at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1559)[122:woodstox-core-asl:4.1.2]
       at com.ctc.wstx.sw.BaseNsStreamWriter.checkStartElement(BaseNsStreamWriter.java:469)[122:woodstox-core-asl:4.1.2]
       at com.ctc.wstx.sw.SimpleNsStreamWriter.writeStartOrEmpty(SimpleNsStreamWriter.java:252)[122:woodstox-core-asl:4.1.2]
       at com.ctc.wstx.sw.BaseNsStreamWriter.writeStartElement(BaseNsStreamWriter.java:317)[122:woodstox-core-asl:4.1.2]
       at org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor$Soap11FaultOutInterceptorInternal.handleMessage(Soap11FaultOutInterceptor.java:75)[135:org.apache.cxf.cxf-rt-bindings-soap:2.6.0]
...

The entire exception can be found in the attached log snippet.

I am posting because am not entirely certain what is the issue here.
Is it my karaf instance, or is it an issue with CXF? A little nudge in
the right direction will help. Thanks!

*Environment*
Java: Oracle/Sun version "1.6.0_32"
Karaf: 2.2.7
ActiveMQ: 5.5.1
CXF: 2.6.0
Camel: 2.9.2

Re: Help with a Karaf/Camel/Cxf/ActiveMQ setup that results in an NPE

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, May 9, 2012 at 9:15 AM, emb <ed...@gmail.com> wrote:
>
> Claus Ibsen-2 wrote
>>
>> Did you use the jre.properties.cxf?
>> eg to replace that with the existing jre.properties.
>>
>
> Yes I did. I deployed camel-example-cxf-osgi to test the installation. And
> it worked fine.
>
>
> Claus Ibsen-2 wrote
>>
>> And after installing all the bundles and whatnot. Have you tried
>> restarting Karaf?
>> And have you tried downgrading to CXF 2.5.x?
>>
>
> Yes to the first question. And I could not install CXF 2.5.3 due to bug
> #CXF-4090
>
>
> Claus Ibsen-2 wrote
>>
>> And again what you assemble is essentially a like Apache ServiceMix,
>> however
>> the SMX team make sure it all works together.
>>
>
> There are multiple reasons we chose to use Karaf directly rather than SMX.
> This includes minimalism, and some earlier issues with upgrading camel. We
> did require camel 2.9. I'll see if I can revisit SMX.
>

SMX 4.4.x onwards makes it easier to upgrade Camel and other dependencies.

Anyway you should be able to assemble your own Karaf installation with
the Apache products,
but as you have seen some combos may cause trouble, and you will have
to dig to figure out why.

Have you tried with Camel 2.10 SNAPSHOT, as this version is supporting
CXF 2.6.0 officially.

And in terms of your error, you only report this sparingly and its
harder for us to help what is wrong.



> --
> View this message in context: http://camel.465427.n5.nabble.com/Help-with-a-Karaf-Camel-Cxf-ActiveMQ-setup-that-results-in-an-NPE-tp5696495p5696650.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Help with a Karaf/Camel/Cxf/ActiveMQ setup that results in an NPE

Posted by emb <ed...@gmail.com>.
Claus Ibsen-2 wrote
> 
> Did you use the jre.properties.cxf?
> eg to replace that with the existing jre.properties.
> 

Yes I did. I deployed camel-example-cxf-osgi to test the installation. And
it worked fine.


Claus Ibsen-2 wrote
> 
> And after installing all the bundles and whatnot. Have you tried
> restarting Karaf?
> And have you tried downgrading to CXF 2.5.x?
> 

Yes to the first question. And I could not install CXF 2.5.3 due to bug
#CXF-4090


Claus Ibsen-2 wrote
> 
> And again what you assemble is essentially a like Apache ServiceMix,
> however
> the SMX team make sure it all works together.
> 

There are multiple reasons we chose to use Karaf directly rather than SMX.
This includes minimalism, and some earlier issues with upgrading camel. We
did require camel 2.9. I'll see if I can revisit SMX.

--
View this message in context: http://camel.465427.n5.nabble.com/Help-with-a-Karaf-Camel-Cxf-ActiveMQ-setup-that-results-in-an-NPE-tp5696495p5696650.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Help with a Karaf/Camel/Cxf/ActiveMQ setup that results in an NPE

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Did you use the jre.properties.cxf?
eg to replace that with the existing jre.properties.

And after installing all the bundles and whatnot. Have you tried
restarting Karaf?
And have you tried downgrading to CXF 2.5.x?

And again what you assemble is essentially a like Apache ServiceMix, however
the SMX team make sure it all works together.


On Wed, May 9, 2012 at 7:45 AM, ED Barwani <ed...@gmail.com> wrote:
> Hello,
>
> I have a camel route that looks like:
>  <camel:route>
>    <camel:from uri="cxf:bean:AddressSearchEndpoint?dataFormat=PAYLOAD" />
>
>    <camel:to uri="xslt:transforms/request.xsl" />
>    <camel:log message="Transformed Request: ${body}" loggingLevel="DEBUG" />
>
>    <camel:to uri="activemq:queue:{{msh.request}}" />
>
>    <camel:to uri="xslt:transforms/response.xsl" />
>    <camel:log message="Transformed Response: ${body}" loggingLevel="DEBUG" />
>  </camel:route>
>
> This route works desirably when I run it using the camel maven plugin
> "mvn camel:run". However, when I run it in the karaf container I get a
> NullPointerException
>
> 2012-05-09 11:26:40,108 | WARN  | tp1202105401-632 |
> Soap11FaultOutInterceptor        |  -  -  | Error writing to
> XMLStreamWriter.
> javax.xml.stream.XMLStreamException: Trying to output second root, <soap:Fault>
>        at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1524)[122:woodstox-core-asl:4.1.2]
>        at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1531)[122:woodstox-core-asl:4.1.2]
>        at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1559)[122:woodstox-core-asl:4.1.2]
>        at com.ctc.wstx.sw.BaseNsStreamWriter.checkStartElement(BaseNsStreamWriter.java:469)[122:woodstox-core-asl:4.1.2]
>        at com.ctc.wstx.sw.SimpleNsStreamWriter.writeStartOrEmpty(SimpleNsStreamWriter.java:252)[122:woodstox-core-asl:4.1.2]
>        at com.ctc.wstx.sw.BaseNsStreamWriter.writeStartElement(BaseNsStreamWriter.java:317)[122:woodstox-core-asl:4.1.2]
>        at org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor$Soap11FaultOutInterceptorInternal.handleMessage(Soap11FaultOutInterceptor.java:75)[135:org.apache.cxf.cxf-rt-bindings-soap:2.6.0]
> ...
>
> The entire exception can be found in the attached log snippet.
>
> I am posting because am not entirely certain what is the issue here.
> Is it my karaf instance, or is it an issue with CXF? A little nudge in
> the right direction will help. Thanks!
>
> *Environment*
> Java: Oracle/Sun version "1.6.0_32"
> Karaf: 2.2.7
> ActiveMQ: 5.5.1
> CXF: 2.6.0
> Camel: 2.9.2



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Help with a Karaf/Camel/Cxf/ActiveMQ setup that results in an NPE

Posted by emb <ed...@gmail.com>.
After spending few more hours a decision was made to revisit SMX. Upgrading
camel in SMX-4.4.1 was simple enough. And the application is running.

Thanks,
ed

--
View this message in context: http://camel.465427.n5.nabble.com/Help-with-a-Karaf-Camel-Cxf-ActiveMQ-setup-that-results-in-an-NPE-tp5696495p5699454.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Help with a Karaf/Camel/Cxf/ActiveMQ setup that results in an NPE

Posted by Daniel Kulp <dk...@apache.org>.
Hmm... Not really sure what the actual cause is.   Can you wireshark the 
interaction and see what did get written?  From the stack trace, it looks 
like a request came in, it was processed, a response was started to be 
written out.   During writing the response, some exception occurred from 
Jetty (no idea why...  maybe client closed the stream or something).  At 
that point, the fault chain was started.  However, since at least part of 
the response was written out already, you get that exception.   Basically, 
when streaming responses, it's nearly impossible to recover from exceptions.   
That's the stack trace you are seeing.

I'm NOT sure what jetty is doing to cause the NPE in Jetty.   No idea on 
that.  :-(

Dan




On Wednesday, May 09, 2012 03:45:39 PM ED Barwani wrote:
> Hello,
> 
> I have a camel route that looks like:
>  <camel:route>
>    <camel:from uri="cxf:bean:AddressSearchEndpoint?dataFormat=PAYLOAD" />
> 
>    <camel:to uri="xslt:transforms/request.xsl" />
>    <camel:log message="Transformed Request: ${body}" loggingLevel="DEBUG"
> />
> 
>    <camel:to uri="activemq:queue:{{msh.request}}" />
> 
>    <camel:to uri="xslt:transforms/response.xsl" />
>    <camel:log message="Transformed Response: ${body}" loggingLevel="DEBUG"
> /> </camel:route>
> 
> This route works desirably when I run it using the camel maven plugin
> "mvn camel:run". However, when I run it in the karaf container I get a
> NullPointerException
> 
> 2012-05-09 11:26:40,108 | WARN  | tp1202105401-632 |
> Soap11FaultOutInterceptor        |  -  -  | Error writing to
> XMLStreamWriter.
> javax.xml.stream.XMLStreamException: Trying to output second root,
> <soap:Fault> at
> com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1
> 524)[122:woodstox-core-asl:4.1.2] at
> com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1
> 531)[122:woodstox-core-asl:4.1.2] at
> com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java
> :1559)[122:woodstox-core-asl:4.1.2] at
> com.ctc.wstx.sw.BaseNsStreamWriter.checkStartElement(BaseNsStreamWriter.j
> ava:469)[122:woodstox-core-asl:4.1.2] at
> com.ctc.wstx.sw.SimpleNsStreamWriter.writeStartOrEmpty(SimpleNsStreamWrit
> er.java:252)[122:woodstox-core-asl:4.1.2] at
> com.ctc.wstx.sw.BaseNsStreamWriter.writeStartElement(BaseNsStreamWriter.j
> ava:317)[122:woodstox-core-asl:4.1.2] at
> org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor$Soap11F
> aultOutInterceptorInternal.handleMessage(Soap11FaultOutInterceptor.java:75
> )[135:org.apache.cxf.cxf-rt-bindings-soap:2.6.0] ...
> 
> The entire exception can be found in the attached log snippet.
> 
> I am posting because am not entirely certain what is the issue here.
> Is it my karaf instance, or is it an issue with CXF? A little nudge in
> the right direction will help. Thanks!
> 
> *Environment*
> Java: Oracle/Sun version "1.6.0_32"
> Karaf: 2.2.7
> ActiveMQ: 5.5.1
> CXF: 2.6.0
> Camel: 2.9.2
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com