camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem jiang <willem.ji...@gmail.com>
Subject Re: Content Enrich Error when upgrading Apache Camel from 2.9.2 to any higher version
Date Tue, 18 Dec 2012 04:02:05 GMT
I think this issue is introduced by CAMEL-5171[1] or CAMEL-5172. You should be able to workaround
it by marshaling the Java object to String before sending the message to the http endpoint.

I just fill a JIRA[3] for it.

[1]https://issues.apache.org/jira/browse/CAMEL-5171
[2]https://issues.apache.org/jira/browse/CAMEL-5172
[3]https://issues.apache.org/jira/browse/CAMEL-5890

--  
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 Tuesday, December 18, 2012 at 12:20 AM, Neo wrote:

> Hi, My current application is using Apache Camel 2.9.2 and in this
> application I am using Content Enricher EIP. The following block of code
> reads a message from JMS Topic , converts it to a Java class and then uses
> one of the key parameters from the XML message and calls a webservice via
> HTTP and enriches the message. I use the HTTP component in Camel for the
> enriching of the message.The following code did the trick with 2.9.2 :
> / GET ${WEB_SERVICE_FOR_MRNSEARCH}  
> MRN=${in.body.patient.mrn}&amp;_type=xml/
>  
> I have just upgraded my application to 2.9.3 ( and > 2.9.3 also) and I get
> the following exception:
> CaughtExceptionType:org.apache.camel.TypeConversionException,
> CaughtExceptionMessage:Error during type conversion from type:
> com.ecc.DamBean to the required type:
> org.apache.commons.httpclient.methods.RequestEntity with value
> com.ecc.DamBean@8811a59 due Error during type conversion from type:
> java.lang.String to the required type:
> org.apache.commons.httpclient.methods.RequestEntity with value ...
> The complete Stack Trace :
> Exchange[ExchangePattern:InOnly, BodyType:String, Body:<?xml version="1.0"
> encoding="UTF-8" standalone="yes"?>,
> CaughtExceptionType:org.apache.camel.TypeConversionException,
> CaughtExceptionMessage:Error during type conversion from type:
> com.ecc.DamBean to the required type:
> org.apache.commons.httpclient.methods.RequestEntity with value
> com.ecc.DamBean@8811a59 due Error during type conversion from type:
> java.lang.String to the required type:
> org.apache.commons.httpclient.methods.RequestEntity with value <?xml
> version="1.0" encoding="UTF-8" standalone="yes"?> due
> java.lang.NullPointerException,
> StackTrace:org.apache.camel.TypeConversionException: Error during type
> conversion from type: com.ecc.DamBean to the required type:
> org.apache.commons.httpclient.methods.RequestEntity with value
> com.ecc.DamBean@8811a59 due Error during type conversion from type:
> java.lang.String to the required type:
> org.apache.commons.httpclient.methods.RequestEntity with value <?xml
> version="1.0" encoding="UTF-8" standalone="yes"?> due
> java.lang.NullPointerException at
> org.apache.camel.converter.jaxb.FallbackTypeConverter.convertTo(FallbackTypeConverter.java:98)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:289)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:111)
> at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:72) at
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:47) at
> org.apache.camel.component.http.HttpProducer.createRequestEntity(HttpProducer.java:390)
> at
> org.apache.camel.component.http.HttpProducer.createMethod(HttpProducer.java:343)
> at
> org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:91)
> at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at org.apache.camel.processor.Enricher.process(Enricher.java:114) at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
> at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:61)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:148) at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:61)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
> at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:57)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:275)
> at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:185)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:139)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:909)
> at java.lang.Thread.run(Thread.java:662)Caused by:
> org.apache.camel.TypeConversionException: Error during type conversion from
> type: java.lang.String to the required type:
> org.apache.commons.httpclient.methods.RequestEntity with value <?xml
> version="1.0" encoding="UTF-8" standalone="yes"?>due
> java.lang.NullPointerException at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:126)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:98)
> at
> org.apache.camel.converter.jaxb.FallbackTypeConverter.marshall(FallbackTypeConverter.java:222)
> at
> org.apache.camel.converter.jaxb.FallbackTypeConverter.convertTo(FallbackTypeConverter.java:94)
> ... 44 moreCaused by: org.apache.camel.RuntimeCamelException:
> java.lang.NullPointerException at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1271)
> at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:927) at
> org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:47)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:253)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:111)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:98)
> at
> org.apache.camel.converter.jaxb.FallbackTypeConverter.marshall(FallbackTypeConverter.java:222)
> at
> org.apache.camel.converter.jaxb.FallbackTypeConverter.convertTo(FallbackTypeConverter.java:94)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:289)
> at
> org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:111)
> at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:72) at
> org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:47) at
> org.apache.camel.component.http.HttpProducer.createRequestEntity(HttpProducer.java:390)
> at
> org.apache.camel.component.http.HttpProducer.createMethod(HttpProducer.java:343)
> at
> org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:91)
> at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at org.apache.camel.processor.Enricher.process(Enricher.java:114) at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)
> at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)
> at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at org.apache.camel.processor.Pipeline.process(Pipeline.java:117) at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:80) at
> org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)
> at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)
> at
> org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
> at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
> at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
> at
> org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:275)
> at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:183)
> at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:139)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> ... 1 moreCaused by: java.lang.NullPointerException at
> org.apache.camel.component.http.RequestEntityConverter.toRequestEntity(RequestEntityConverter.java:51)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597) at
> org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:923) ...
> 50 more]
>  
> Can some one please throw light on this issue ? I went through all the
> release notes in Camel 2.9.3 and 2.9.4 , didnt really get any pointers. I
> tried changing my code to call the service with no HTTP_QUERY parameters (
> but I did embed them directly in the HTTP_URI - but no change same
> exception.
>  
> Can anyone please provide me some light :) ??Cheers,Sree
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Content-Enrich-Error-when-upgrading-Apache-Camel-from-2-9-2-to-any-higher-version-tp5724244.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).




Mime
View raw message