You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by jydev <jy...@gmail.com> on 2009/05/08 03:43:57 UTC

NullPointerException in AMQMessageStore.addMessage in AMQ 5.2

Hi,

Intermittently, we get a NullPointerException while sending a message out
and not sure what's causing it.

Caused by: java.lang.NullPointerException
	at
org.apache.activemq.store.amq.AMQMessageStore.addMessage(AMQMessageStore.java:129)
	at org.apache.activemq.broker.region.Queue.doMessageSend(Queue.java:440)
	at org.apache.activemq.broker.region.Queue$6.run(Queue.java:362)
	at org.apache.activemq.broker.region.Queue.iterate(Queue.java:1020)
	at
org.apache.activemq.thread.DeterministicTaskRunner.runTask(DeterministicTaskRunner.java:84)
	at
org.apache.activemq.thread.DeterministicTaskRunner$1.run(DeterministicTaskRunner.java:41)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)


    public final void addMessage(ConnectionContext context, final Message
message) throws IOException {
        final MessageId id = message.getMessageId();
        final Location location = peristenceAdapter.writeCommand(message,
message.isResponseRequired());
        if (!context.isInTransaction()) {
....
            transactionStore.addMessage(this, message, location);
            context.getTransaction().addSynchronization(new
Synchronization() {  <<<<<<<<<<< NPE here

Not sure how it can get NPE since context and transactions are deferenced in
prior lines, unless transaction is set to null by another thread (not sure
if that's possible)

I know we have some network issues that cause to drop connection.  We have
failover in place in connection pool.  There were no indication of abnormal
connection issues around the time the exception occurred.

Any idea what's going on?

Thanks

-- 
View this message in context: http://www.nabble.com/NullPointerException-in-AMQMessageStore.addMessage-in-AMQ-5.2-tp23438691p23438691.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: NullPointerException in AMQMessageStore.addMessage in AMQ 5.2

Posted by jydev <jy...@gmail.com>.
Not sure what you mean by "raise an issue".  You mean if I had submitted a
bug?  No, I haven't yet since I didn't have a readily reproducible test
cases.

Here is the full stack that wraps the root cause that I posted before.

org.springframework.jms.UncategorizedJmsException: Uncategorized exception
occured during JMS processing; nested exception is javax.jms.JMSException:
java.lang.NullPointerException
	at
org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:308)
	at
org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:168)
	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)
	at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:548)
	at com.foo.MessageServiceImpl.sendMessage
	at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:543)
	at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:482)
	at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:974)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876)
	at java.lang.Thread.run(Thread.java:619)
Caused by: javax.jms.JMSException: java.lang.NullPointerException
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49)
	at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1244)
	at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1659)
	at
org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:227)
	at org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:74)
	at org.apache.activemq.pool.PooledProducer.send(PooledProducer.java:59)
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:597)
	at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:574)
	at org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:551)
	at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:471)
	... 18 more
Caused by: java.lang.NullPointerException
	at org.apache.activemq.broker.region.Queue.doMessageSend(Queue.java:449)
	at org.apache.activemq.broker.region.Queue$6.run(Queue.java:362)
	at org.apache.activemq.broker.region.Queue.iterate(Queue.java:1020)
	at
org.apache.activemq.thread.DeterministicTaskRunner.runTask(DeterministicTaskRunner.java:84)
	at
org.apache.activemq.thread.DeterministicTaskRunner$1.run(DeterministicTaskRunner.java:41)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	... 1 more

-- 
View this message in context: http://www.nabble.com/NullPointerException-in-AMQMessageStore.addMessage-in-AMQ-5.2-tp23438691p24038762.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: NullPointerException in AMQMessageStore.addMessage in AMQ 5.2

Posted by Rob Davies <ra...@gmail.com>.
Did you raise an issue - with stack trace ?

On 12 Jun 2009, at 22:42, jydev wrote:

>
> Hi
>
> I posted this a while back and we are still having this issue.  It  
> seems
> happen only when there is "large" load, meaning maybe 1500-2500  
> messages in
> the queue.  So my guess is we might be hitting some resource limit and
> hitting this issue.
>
> Any idea?
>
> Thanks
> -- 
> View this message in context: http://www.nabble.com/NullPointerException-in-AMQMessageStore.addMessage-in-AMQ-5.2-tp23438691p24006474.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>


Re: NullPointerException in AMQMessageStore.addMessage in AMQ 5.2

Posted by jydev <jy...@gmail.com>.
Hi

I posted this a while back and we are still having this issue.  It seems
happen only when there is "large" load, meaning maybe 1500-2500 messages in
the queue.  So my guess is we might be hitting some resource limit and
hitting this issue.

Any idea?

Thanks
-- 
View this message in context: http://www.nabble.com/NullPointerException-in-AMQMessageStore.addMessage-in-AMQ-5.2-tp23438691p24006474.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.