You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Homayoun Zariv (JIRA)" <ji...@apache.org> on 2015/04/24 07:48:38 UTC

[jira] [Created] (CAMEL-8694) java.lang.NullPointerException in at org.apache.camel.component.netty4.http.NettyHttpProducer$NettyHttpProducerCallback.done

Homayoun Zariv created CAMEL-8694:
-------------------------------------

             Summary: java.lang.NullPointerException in at org.apache.camel.component.netty4.http.NettyHttpProducer$NettyHttpProducerCallback.done
                 Key: CAMEL-8694
                 URL: https://issues.apache.org/jira/browse/CAMEL-8694
             Project: Camel
          Issue Type: Bug
          Components: camel-netty4-http
    Affects Versions: 2.15.1
            Reporter: Homayoun Zariv


I am using camel-netty4-http 2.15.1 version and getting the following NPE in org.apache.camel.component.netty4.http.NettyHttpProducer$NettyHttpProducerCallback.done. Debugging through the code it seems like null check for response is missing.

 public void done(boolean doneSync) {
            try {
                NettyHttpMessage nettyMessage = exchange.hasOut() ? exchange.getOut(NettyHttpMessage.class) : exchange.getIn(NettyHttpMessage.class);
                if (nettyMessage != null) {
                    FullHttpResponse response = nettyMessage.getHttpResponse();
                    // Need to retain the ByteBuffer for producer to consumer
                    // TODO Remove this part of ByteBuffer right away
                    response.content().retain();  <-- response in null
                    if (response != null) {

java.lang.NullPointerException
	at org.apache.camel.component.netty4.http.NettyHttpProducer$NettyHttpProducerCallback.done(NettyHttpProducer.java:98)
	at org.apache.camel.component.netty4.NettyProducer.process(NettyProducer.java:181)
	at org.apache.camel.component.netty4.http.NettyHttpProducer.process(NettyHttpProducer.java:52)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
	at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:111)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
	at org.apache.camel.component.netty4.handlers.ServerChannelHandler.processAsynchronously(ServerChannelHandler.java:134)
	at org.apache.camel.component.netty4.handlers.ServerChannelHandler.channelRead0(ServerChannelHandler.java:105)
	at org.apache.camel.component.netty4.http.handlers.HttpServerChannelHandler.channelRead0(HttpServerChannelHandler.java:202)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at org.apache.camel.component.netty4.http.handlers.HttpServerMultiplexChannelHandler.channelRead0(HttpServerMultiplexChannelHandler.java:119)
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
	at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:32)
	at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:329)
	at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:36)
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
	at java.lang.Thread.run(Thread.java:744)



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