<div dir="ltr">I have a service which looks like below. For some reason, I get a NullPointerException error when it tries to perform the "doInvoke". How can I have the doInvoke service execute successfully without going to the catch block. It has to be done inside the "handleDelivery". It works if I perform the "doInvoke" outside of the "handleDelivery".<div>
<br></div><div>try {</div><div> channel.basicConsume(strQueueName, false,<div><div><span class="" style="white-space:pre"> </span>new DefaultConsumer(channel) {</div><div><span class="" style="white-space:pre"> </span>@Override</div>
<div><span class="" style="white-space:pre"> </span>public void handleDelivery(String consumerTag,</div><div><span class="" style="white-space:pre"> </span>Envelope envelope,</div><div><span class="" style="white-space:pre"> </span>AMQP.BasicProperties props,</div>
<div><span class="" style="white-space:pre"> </span>byte[] body)</div><div><span class="" style="white-space:pre"> </span>throws IOException</div><div><span class="" style="white-space:pre"> </span>{</div><div><br>
</div><div><span class="" style="white-space:pre"> </span> try<br></div><div><span class="" style="white-space:pre"> </span> {</div><div> Service.doInvoke(NSName, pipeline);<br>
</div><div><span class="" style="white-space:pre"> </span> }</div><div> catch (Exception e) {</div><div><span class="" style="white-space:pre"> </span>}</div><div><span class=""></span><span class="" style="white-space:pre"> </span>}</div>
<div><span class="" style="white-space:pre"> </span>});</div></div></div><div>} catch (Exception e1) {</div><div>}</div></div>