You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Valery <va...@gmail.com> on 2013/08/24 12:19:24 UTC

Camel throws StackOverflowException while converting message body

Hi there!

A have route:
 from("cxf:/CDAMediationService?serviceClass=" +
CDAMediationService.class.getName())
                .process(new RequestProcessor())
                .log(LoggingLevel.INFO , "Request before
transformation:\n${body}")
                .to("xslt:xslt/MediateCDARequest.xslt")
                .log(LoggingLevel.INFO , "Request after
transformation:\n${body}")
                .process(new HeaderSetterProcessor())
                .to("cxf://"+cdaUri+"?serviceClass=" +
Invoke.class.getName())
                .wireTap("direct:saveResponse")
                .log(LoggingLevel.INFO , "Respone before
transformation:\n${body}")
                .to("xslt:xslt/MediateCDAResponse.xslt")
                .log(LoggingLevel.INFO , "Response after
transformation:\n${body}")
                .process(new ResponseProcessor());

Somewhere between 5th and 7th row it throws StackOverflowException (i
attached log file with stack trace). log.txt
<http://camel.465427.n5.nabble.com/file/n5737854/log.txt>  
I need help to solve this problem, or find round way.

P.S. sorry for my english:)



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel throws StackOverflowException while converting message body

Posted by Christian Müller <ch...@gmail.com>.
It looks like your body is a "java.util.Scanner" and you try to convert
this into a "java.util.List" what isn't working:

ERROR \--> Previous exception on exchangeId:
ID-vsedykh-nb-54170-1377503204942-0-2
org.apache.camel.TypeConversionException: Error during type conversion from
type: java.util.Scanner to the required type: java.util.List with value
java.util.Scanner[delimiters=,(?!(?:[^\(,]|[^\)],[^\)])+\))][position=0][match
valid=false][need input=false][source closed=false][skipped=false][group
separator=\�][decimal separator=\,][positive prefix=][negative
prefix=\Q-\E][positive suffix=][negative suffix=][NaN
string=\Q?\E][infinity string=\Q?\E] due java.lang.StackOverflowError

Can you enable tracing and check it? Did you hide something from your route?

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642

Re: Camel throws StackOverflowException while converting message body

Posted by Valery <va...@gmail.com>.
i tried that, it didn't work. There was the same error but in
CxfProducer.class. Code in headerSetterprocessor was copied from CxfProducer
(i explained why in comments in HeaderSetterprocessor).

Best,
valery



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854p5738014.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel throws StackOverflowException while converting message body

Posted by Christian Müller <ch...@gmail.com>.
Some thoughts:

Instead of using your HeaderSetterProcessor, you could do:
from("...")
...
.setHeader(CxfConstants.OPERATION_NAMESPACE, constant("
http://invoker.ps.eos.fairisaac.com"))
.setHeader(CxfConstants.OPERATION_NAME, constant("processRequest"))
.convertBodyTo(YourPayload.class)
...

what is more expressive.

However, in your HeaderSetterProcessor on line 42, you do
List<?> list = exchng.getContext().getTypeConverter().convertTo(List.class,
it);

which is the root cause for this exception:
ERROR \--> Previous exception on exchangeId:
ID-vsedykh-nb-50709-1377338945967-0-2
org.apache.camel.TypeConversionException: Error during type conversion from
type: java.util.Scanner to the required type: java.util.List

It doesn't really fit into the route you shared...

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Mon, Aug 26, 2013 at 1:13 PM, Valery <va...@gmail.com> wrote:

> I found round way: I replaced camel cxf component call by direct CXF usage
> in
> processor. now it works fine. But i will participate in this case and will
> help you (as posible) to understand and fix it.
>
> Thanks,
> Valery
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854p5737955.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Camel throws StackOverflowException while converting message body

Posted by Valery <va...@gmail.com>.
I found round way: I replaced camel cxf component call by direct CXF usage in
processor. now it works fine. But i will participate in this case and will
help you (as posible) to understand and fix it.

Thanks,
Valery



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854p5737955.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel throws StackOverflowException while converting message body

Posted by Valery <va...@gmail.com>.
I change my route in way to exclude HeaderSetterprocessor. it looks like
that:
from("cxf:/CDAMediationService?serviceClass=" +
CDAMediationService.class.getName())
                .process(new RequestProcessor())
                .log(LoggingLevel.INFO, "Request before
transformation:\n${body}")
                .to("xslt:xslt/MediateCDARequest.xslt")
                .log(LoggingLevel.INFO, "Request after
transformation:\n${body}")
               
.setHeader(CxfConstants.OPERATION_NAMESPACE).simple("http://invoker.ps.eos.fairisaac.com")
               
.setHeader(CxfConstants.OPERATION_NAME).simple("processRequest")
                //.process(new HeaderSetterProcessor())
                .to("cxf://" + cdaUri + "?serviceClass=" +
Invoke.class.getName())
                .wireTap("direct:saveResponse")
                .log(LoggingLevel.INFO, "Respone before
transformation:\n${body}")
                .to("xslt:xslt/MediateCDAResponse.xslt")
                .log(LoggingLevel.INFO, "Response after
transformation:\n${body}")
                .process(new ResponseProcessor());

But error saved ( stackTrace.log
<http://camel.465427.n5.nabble.com/file/n5737931/stackTrace.log>  ). So i
thing problem in CxfProducer class. I wanna try another ws implementation.
What would you recommend?

Best,
Valery



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854p5737931.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel throws StackOverflowException while converting message body

Posted by Valery <va...@gmail.com>.
There is  FaultProcessor.java
<http://camel.465427.n5.nabble.com/file/n5737924/FaultProcessor.java>  

And I just tried route with java version 1.7.0_10 - i got the same error, so
problem not in java.

Best,
Valery



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854p5737924.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel throws StackOverflowException while converting message body

Posted by Christian Müller <ch...@gmail.com>.
Could you please also share the FaultProcessor.

Thanks,
Christian
Am 25.08.2013 22:09 schrieb "Valery" <va...@gmail.com>:

> Ok, I will try older java version and write here about results.
> Yes, i use 'onException' definition in global scope:
>      onException(Exception.class).handled(true).process(new
> FaultProcessor());
> this string places just before route definition.
> Here is my  HeaderSetterProcessor.java
> <
> http://camel.465427.n5.nabble.com/file/n5737918/HeaderSetterProcessor.java
> >
> . There I set header options for cxf endpoint and there is code that i
> found
> in camel sources and pasted there because it doesn't work under the hood
> for
> some reasons.
>
> Thank for your participation.
>
> Best,
> Valery
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854p5737918.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Camel throws StackOverflowException while converting message body

Posted by Valery <va...@gmail.com>.
Ok, I will try older java version and write here about results.
Yes, i use 'onException' definition in global scope:
     onException(Exception.class).handled(true).process(new
FaultProcessor());
this string places just before route definition.
Here is my  HeaderSetterProcessor.java
<http://camel.465427.n5.nabble.com/file/n5737918/HeaderSetterProcessor.java> 
. There I set header options for cxf endpoint and there is code that i found
in camel sources and pasted there because it doesn't work under the hood for
some reasons.

Thank for your participation.

Best,
Valery



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854p5737918.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel throws StackOverflowException while converting message body

Posted by Christian Müller <ch...@gmail.com>.
First of all, Java 1.6.0_20 is really old and some bug fixes behind the
latest one which is 1.6.0_43. Please consider to upgrade...

Do you use an 'onException' definition (route or global scope) to handle
your errors?
Can you please share the HeaderSetterProcessor with us!?

Best
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Sun, Aug 25, 2013 at 12:00 AM, Valery <va...@gmail.com> wrote:

> Hello, Christian!
>
> - I attached complete stack trace in my previous message. I can post it
> here
> if you say
> - i tried version 2.11.0 and 2.11.1
> - Java 1.6.0_20
> - It's no problem, I can provide this sources
>
> Best,
> Valery
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854p5737873.html
> Sent from the Camel - Users mailing list archive at Nabble.com.,
>

Re: Camel throws StackOverflowException while converting message body

Posted by Valery <va...@gmail.com>.
Hello, Christian!

- I attached complete stack trace in my previous message. I can post it here
if you say
- i tried version 2.11.0 and 2.11.1
- Java 1.6.0_20
- It's no problem, I can provide this sources

Best,
Valery



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854p5737873.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel throws StackOverflowException while converting message body

Posted by Christian Müller <ch...@gmail.com>.
Valery, please have first a look at [1].
We need some more information, if you expect help from us:
- Complete stack trace
- Which Camel version do you use?
- Which java version do you use?
- Later, we are may also interested in the RequestProcessor,
HeaderSetterProcessor or ResponseProcessor...

[1] http://camel.apache.org/support.html

Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Sat, Aug 24, 2013 at 12:19 PM, Valery <va...@gmail.com> wrote:

> Hi there!
>
> A have route:
>  from("cxf:/CDAMediationService?serviceClass=" +
> CDAMediationService.class.getName())
>                 .process(new RequestProcessor())
>                 .log(LoggingLevel.INFO , "Request before
> transformation:\n${body}")
>                 .to("xslt:xslt/MediateCDARequest.xslt")
>                 .log(LoggingLevel.INFO , "Request after
> transformation:\n${body}")
>                 .process(new HeaderSetterProcessor())
>                 .to("cxf://"+cdaUri+"?serviceClass=" +
> Invoke.class.getName())
>                 .wireTap("direct:saveResponse")
>                 .log(LoggingLevel.INFO , "Respone before
> transformation:\n${body}")
>                 .to("xslt:xslt/MediateCDAResponse.xslt")
>                 .log(LoggingLevel.INFO , "Response after
> transformation:\n${body}")
>                 .process(new ResponseProcessor());
>
> Somewhere between 5th and 7th row it throws StackOverflowException (i
> attached log file with stack trace). log.txt
> <http://camel.465427.n5.nabble.com/file/n5737854/log.txt>
> I need help to solve this problem, or find round way.
>
> P.S. sorry for my english:)
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-throws-StackOverflowException-while-converting-message-body-tp5737854.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>