camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-5890) NPE when jaxb fallback converter is used with RequestEntityConverter
Date Fri, 18 Jan 2013 01:56:12 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-5890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Willem Jiang resolved CAMEL-5890.
---------------------------------

    Resolution: Fixed

Applied the patch into trunk, camel-2.10.x and camel-2.9.x branches.
                
> NPE when jaxb fallback converter is used with RequestEntityConverter
> --------------------------------------------------------------------
>
>                 Key: CAMEL-5890
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5890
>             Project: Camel
>          Issue Type: Bug
>    Affects Versions: 2.9.4, 2.9.5, 2.10.2, 2.10.3
>            Reporter: Willem Jiang
>            Assignee: Willem Jiang
>             Fix For: 2.9.6, 2.10.4, 2.11.0
>
>
> As the RequestEntityConverter.toRequestEntity(String str, Exchange exchange) doesn't
has check if the exchange is null, it caused the NPE as the user complain in camel user mailing
list[1]
> [1]http://camel.465427.n5.nabble.com/Content-Enrich-Error-when-upgrading-Apache-Camel-from-2-9-2-to-any-higher-version-td5724244.html
> Here is the stack trace.
> {code}
> 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:, 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 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 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 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]
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message