sometimes java.lang.NullPointerException

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

sometimes java.lang.NullPointerException

alexey
I'm using activemq 5.9.0 and sometimes get the following exception:

INFO   | jvm 1    | 2014/09/08 13:14:14 | Exception in thread "ActiveMQ BrokerService[ig2-4] Task-15" java.lang.NullPointerException
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.openwire.v5.BaseDataStreamMarshaller.tightMarshalByteSequence2(BaseDataStreamMarshaller.java:431)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.openwire.v5.MessageMarshaller.tightMarshal2(MessageMarshaller.java:181)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.openwire.v5.ActiveMQMessageMarshaller.tightMarshal2(ActiveMQMessageMarshaller.java:89)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.openwire.v5.ActiveMQBytesMessageMarshaller.tightMarshal2(ActiveMQBytesMessageMarshaller.java:89)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.openwire.OpenWireFormat.tightMarshalNestedObject2(OpenWireFormat.java:433)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.openwire.v5.BaseDataStreamMarshaller.tightMarshalNestedObject2(BaseDataStreamMarshaller.java:136)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.openwire.v5.MessageDispatchMarshaller.tightMarshal2(MessageDispatchMarshaller.java:105)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.openwire.OpenWireFormat.marshal(OpenWireFormat.java:243)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.java:175)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.transport.AbstractInactivityMonitor.doOnewaySend(AbstractInactivityMonitor.java:304)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.transport.AbstractInactivityMonitor.oneway(AbstractInactivityMonitor.java:286)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.java:85)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:104)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.broker.TransportConnection.dispatch(TransportConnection.java:1339)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.broker.TransportConnection.processDispatch(TransportConnection.java:858)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.broker.TransportConnection.iterate(TransportConnection.java:904)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
INFO   | jvm 1    | 2014/09/08 13:14:14 | at java.lang.Thread.run(Thread.java:722)



It happens with traffic and without. I have investigated little bit the source code and found out that it may happen when broker tries to send a message without header parameters (it checks the length of marshaled parameters when it is null). The questions are:
Why the broker tries to send a message without header parameters even if there is no traffic?
Can it harm in any way and if so, then how would it harm?
How can I configure the broker to prevent that exception?

Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: sometimes java.lang.NullPointerException

Tim Bain
Have you tried attaching a debugger to the broker and setting a conditional
breakpoint (with the condition that the header in question is null) to see
better what's going on?  I've had pretty good luck figuring out what
ActiveMQ is doing using that approach, so it might help you figure out why
it's happening and possibly how to avoid it.

I obviously didn't answer the question about what harm might come from not
fixing the problem, so hopefully someone else here can answer that...

Tim

On Sun, Sep 28, 2014 at 8:18 AM, alexey <[hidden email]> wrote:

> I'm using activemq 5.9.0 and sometimes get the following exception:
>
> INFO   | jvm 1    | 2014/09/08 13:14:14 | Exception in thread "ActiveMQ
> BrokerService[ig2-4] Task-15" java.lang.NullPointerException
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.openwire.v5.BaseDataStreamMarshaller.tightMarshalByteSequence2(BaseDataStreamMarshaller.java:431)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.openwire.v5.MessageMarshaller.tightMarshal2(MessageMarshaller.java:181)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.openwire.v5.ActiveMQMessageMarshaller.tightMarshal2(ActiveMQMessageMarshaller.java:89)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.openwire.v5.ActiveMQBytesMessageMarshaller.tightMarshal2(ActiveMQBytesMessageMarshaller.java:89)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.openwire.OpenWireFormat.tightMarshalNestedObject2(OpenWireFormat.java:433)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.openwire.v5.BaseDataStreamMarshaller.tightMarshalNestedObject2(BaseDataStreamMarshaller.java:136)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.openwire.v5.MessageDispatchMarshaller.tightMarshal2(MessageDispatchMarshaller.java:105)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.openwire.OpenWireFormat.marshal(OpenWireFormat.java:243)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.transport.tcp.TcpTransport.oneway(TcpTransport.java:175)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.transport.AbstractInactivityMonitor.doOnewaySend(AbstractInactivityMonitor.java:304)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.transport.AbstractInactivityMonitor.oneway(AbstractInactivityMonitor.java:286)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.transport.TransportFilter.oneway(TransportFilter.java:85)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.transport.WireFormatNegotiator.oneway(WireFormatNegotiator.java:104)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
> org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:68)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.broker.TransportConnection.dispatch(TransportConnection.java:1339)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.broker.TransportConnection.processDispatch(TransportConnection.java:858)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.broker.TransportConnection.iterate(TransportConnection.java:904)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
> org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> INFO   | jvm 1    | 2014/09/08 13:14:14 |       at
> java.lang.Thread.run(Thread.java:722)
>
>
>
> It happens with traffic and without. I have investigated little bit the
> source code and found out that it may happen when broker tries to send a
> message without header parameters (it checks the length of marshaled
> parameters when it is null). The questions are:
> Why the broker tries to send a message without header parameters even if
> there is no traffic?
> Can it harm in any way and if so, then how would it harm?
> How can I configure the broker to prevent that exception?
>
> Thank you.
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/sometimes-java-lang-NullPointerException-tp4685956.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: sometimes java.lang.NullPointerException

alexey
Tim,

The problem is that I can't use debugger. Unfortunately it reproduces very rare and I haven't succeeded to reproduce it in my lab conditions yet, so I have only logs from the field.

Anyway, thank you for advice!