camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-8408) Camel-Netty4-HTTP throws exception with async processor containing CompletableFuture
Date Thu, 26 Feb 2015 13:03:05 GMT

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

Claus Ibsen resolved CAMEL-8408.
--------------------------------
    Resolution: Not a Problem
      Assignee: Claus Ibsen

> Camel-Netty4-HTTP throws exception with async processor containing CompletableFuture
> ------------------------------------------------------------------------------------
>
>                 Key: CAMEL-8408
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8408
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-netty4-http
>    Affects Versions: 2.14.1
>         Environment: Windows/Linux Tomcat 7.0.54
>            Reporter: Amit R
>            Assignee: Claus Ibsen
>              Labels: Netty
>
> When using async processor which contains completable future callback I get the below
exception. the exception can be seen when callback is being called. i.e: in the async processor
process method I have something like this: 
> @Override
> public boolean Process(Exchange exchange, AsyncCallback callback){
>       completableFuture = myApi.getCompletableFuture();
>       completableFuture.whenComplete((response)->{
>            exchange.setProperty("abc", "def");
>            callback.done(false);
>    })
>    return false;
> }
> Thx, Amit.
> Exception:
> Caused by: [org.apache.camel.TypeConversionException - Error during type conversion from
type: java.lang.String to the required type: byte[] with value [Body is instance of org.apache.camel.StreamCache]
due io.netty.util.IllegalReferenceCountException: refCnt: 0]
> org.apache.camel.TypeConversionException: Error during type conversion from type: java.lang.String
to the required type: byte[] with value [Body is instance of org.apache.camel.StreamCache]
due io.netty.util.IllegalReferenceCountException: refCnt: 0
> 	at org.apache.camel.impl.converter.BaseTypeConverterRegistry.createTypeConversionException(BaseTypeConverterRegistry.java:567)
~[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:131)
~[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:72) ~[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.impl.MessageSupport.getBody(MessageSupport.java:47) ~[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.component.netty4.http.DefaultNettyHttpBinding.toNettyResponse(DefaultNettyHttpBinding.java:350)
~[camel-netty4-http-2.14.1.jar:2.14.1]
> 	at org.apache.camel.component.netty4.http.handlers.HttpServerChannelHandler.getResponseBody(HttpServerChannelHandler.java:302)
~[camel-netty4-http-2.14.1.jar:2.14.1]
> 	at org.apache.camel.component.netty4.handlers.ServerChannelHandler.sendResponse(ServerChannelHandler.java:152)
~[camel-netty4-2.14.1.jar:2.14.1]
> 	at org.apache.camel.component.netty4.handlers.ServerChannelHandler.access$100(ServerChannelHandler.java:39)
~[camel-netty4-2.14.1.jar:2.14.1]
> 	at org.apache.camel.component.netty4.handlers.ServerChannelHandler$1.done(ServerChannelHandler.java:140)
~[camel-netty4-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:145) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:428)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:81)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.ChoiceProcessor$1.done(ChoiceProcessor.java:72) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:428)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:81)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.SendProcessor$1.done(SendProcessor.java:131) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:145) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:428)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:81)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.ChoiceProcessor$1.done(ChoiceProcessor.java:72) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:428)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:81)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.SendProcessor$1.done(SendProcessor.java:131) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:145) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:428)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:81)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.ChoiceProcessor$1.done(ChoiceProcessor.java:72) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:428)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:81)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.SendProcessor$1.done(SendProcessor.java:131) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:145) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:428)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:81)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.SendProcessor$1.done(SendProcessor.java:131) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:145) [camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:428)
[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:81)
[camel-core-2.14.1.jar:2.14.1]
> 	at com.companyXXX.ip.frontend.facade.agent.legacy.translator.processors.ZZZAsyncProcessor.lambda$process$0(ZZZAsyncProcessor.java:39)
[facade-agent-legacy-translator-0.1.2.0-SNAPSHOT.jar:na]
> 	at com.companyXXX.ip.frontend.facade.agent.legacy.translator.processors.ZZZAsyncProcessor$$Lambda$26/30716559.accept(Unknown
Source) [facade-agent-legacy-translator-0.1.2.0-SNAPSHOT.jar:na]
> 	at java.util.concurrent.CompletableFuture$AsyncWhenComplete.exec(CompletableFuture.java:648)
[na:1.8.0_05]
> 	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [na:1.8.0_05]
> 	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:902) [na:1.8.0_05]
> 	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1689) [na:1.8.0_05]
> 	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1644) [na:1.8.0_05]
> 	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [na:1.8.0_05]
> Caused by: org.apache.camel.RuntimeCamelException: io.netty.util.IllegalReferenceCountException:
refCnt: 0
> 	at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1364)
~[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1006) ~[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.impl.converter.StaticMethodTypeConverter.convertTo(StaticMethodTypeConverter.java:59)
~[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.impl.converter.BaseTypeConverterRegistry.doConvertTo(BaseTypeConverterRegistry.java:276)
~[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.impl.converter.BaseTypeConverterRegistry.convertTo(BaseTypeConverterRegistry.java:114)
~[camel-core-2.14.1.jar:2.14.1]
> 	... 56 common frames omitted
> Caused by: io.netty.util.IllegalReferenceCountException: refCnt: 0
> 	at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1187) ~[netty-buffer-4.0.24.Final.jar:4.0.24.Final]
> 	at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1170) ~[netty-buffer-4.0.24.Final.jar:4.0.24.Final]
> 	at io.netty.buffer.AbstractByteBuf.readBytes(AbstractByteBuf.java:676) ~[netty-buffer-4.0.24.Final.jar:4.0.24.Final]
> 	at io.netty.buffer.CompositeByteBuf.readBytes(CompositeByteBuf.java:1461) ~[netty-buffer-4.0.24.Final.jar:4.0.24.Final]
> 	at io.netty.buffer.CompositeByteBuf.readBytes(CompositeByteBuf.java:40) ~[netty-buffer-4.0.24.Final.jar:4.0.24.Final]
> 	at org.apache.camel.component.netty4.http.NettyChannelBufferStreamCache.read(NettyChannelBufferStreamCache.java:69)
~[camel-netty4-http-2.14.1.jar:2.14.1]
> 	at org.apache.camel.component.netty4.http.NettyChannelBufferStreamCache.read(NettyChannelBufferStreamCache.java:54)
~[camel-netty4-http-2.14.1.jar:2.14.1]
> 	at org.apache.camel.util.IOHelper.copy(IOHelper.java:196) ~[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.util.IOHelper.copy(IOHelper.java:169) ~[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.util.IOHelper.copy(IOHelper.java:165) ~[camel-core-2.14.1.jar:2.14.1]
> 	at org.apache.camel.component.netty4.http.NettyChannelBufferStreamCache.writeTo(NettyChannelBufferStreamCache.java:84)
~[camel-netty4-http-2.14.1.jar:2.14.1]
> 	at org.apache.camel.converter.stream.StreamCacheConverter.convertToByteArray(StreamCacheConverter.java:102)
~[camel-core-2.14.1.jar:2.14.1]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_05]
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[na:1.8.0_05]
> 	at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_05]
> 	at org.apache.camel.util.ObjectHelper.invokeMethod(ObjectHelper.java:1002) ~[camel-core-2.14.1.jar:2.14.1]
> 	... 59 common frames omitted



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message