You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Fredrik Jonson <fr...@myrealbox.com> on 2006/07/07 17:46:22 UTC

StackOveflowError in slow message consumer, why?

Hello all, 

I've written an application that uses activemq for intercomponent
communication, and it's doing really well, even though I'm new to JMS
in general and activemq in particular.

Now, I have this component, a message listener, that in turn use corba to
communicate with a separate system. Today that external system went down.
The result was that the MessageListener waited for the corba requests to
return, which didn't occur until the external system came back on line.
This message listener simply turned into a dog slow consumer, taking several
minutes to consume a single message.

The strange thing is that sometimes, say every two minutes or so, I saw
a warning from the message listener, that it could not process a message
due to a StackOverflowError. Now, activemq behaved nicely and redelivered
the message, so nothing was lost, so far so good. The thing is that I
have no clue where that stack overflow came from? Is it my code or
activemq?

2006-07-07 15:51:12,336  WARN [JmsSessionDispatcher: 1]
(ActiveMQMessageConsumer.java:464) org.activemq.ActiveMQMessageConsumer -
could not process message: ACTIVEMQ_OBJECT_MESSAGE: id = 0 ActiveMQMessage{
, jmsMessageID = null, bodyAsBytes = org.activemq.io.util.ByteArray@1703484,
rea dOnlyMessage = true, jmsClientID = 'ID:sal-53843-1152279579128-19:0' ,
jmsCorrelationID = 'null' , jmsDestination = jms.QueueName.COMMAND,
jmsReplyTo = null, jmsDeliveryMode = 2, jmsRedelivered = false, jmsType =
'null' , jmsExpiration = 0, jmsPriority = 4, jmsTimestamp = 115228012 6444,
properties = {secure=false, host=172.16.0.2, port=19675, cid=block},
readOnlyProperties = true, entryBrokerName = 'ID:sal-58332-115063465
2952-0:0' , entryClusterName = 'default' , consumerNos = [0], transactionId
= 'null' , xaTransacted = false, consumerIdentifer = 'ID:sal-53843-
1152279579128-42:0.1.1' , messageConsumed = false, transientConsumed =
false, sequenceNumber = 0, deliveryCount = 1, dispatchedFromDLQ = false,
messageAcknowledge = org.activemq.ActiveMQSession@187e184,
jmsMessageIdentity = null, producerKey = ID:sal-53843-1152279579128-1403: }
ActiveM QObjectMessage{ object = interpreter.InterpreterCommand@114ef62 }.
Reason: java.lang.StackOverflowError java.lang.StackOverflowError

Is this normal behaviour, or is it something wrong, and if so, how do I go
on with trouble shooting?

TIA && regards
-- 
Fredrik Jonson


Re: StackOveflowError in slow message consumer, why?

Posted by Fredrik Jonson <fr...@myrealbox.com>.
James Strachan wrote: 

> Until we see a stack trace there's not much for us to go on - e.g. it
> could be in your consumer code for all we know. StackOverflowError can
> happen if you have excessive recursion in your code.

I thought so. I'll try to get some time to run it under -Xint, and I'll
get back to the list after that's done, so that you know what the issue
really was. 

Actually, due to time constraints and because ActiveMQ is so darned fault
tolerant and redelivers those messages, I have had to put this issue on the
back burner. That's what you get for writing a great pice of software! =)

-- 
Fredrik Jonson


Re: StackOveflowError in slow message consumer, why?

Posted by James Strachan <ja...@gmail.com>.
Until we see a stack trace there's not much for us to go on - e.g. it
could be in your consumer code for all we know. StackOverflowError can
happen if you have excessive recursion in your code.

On 7/10/06, Fredrik Jonson <fr...@myrealbox.com> wrote:
> I wrote:
>
> > The strange thing is that sometimes, say every two minutes or so, I saw
> > a warning from the message listener, that it could not process a message
> > due to a StackOverflowError.
> >
> > 2006-07-07 15:51:12,336  WARN [JmsSessionDispatcher: 1]
> > (ActiveMQMessageConsumer.java:464) org.activemq.ActiveMQMessageConsumer -
> > could not process message: ACTIVEMQ_OBJECT_MESSAGE: [...]
> > Reason: java.lang.StackOverflowError java.lang.StackOverflowError
>
> Just a small followup on myself here.
>
> I was a bit surprised that the StackOverflowError didn't produce an stack
> trace. After a bit of research I suspect that it is an bug in the Sun 1.4.2
> library. I haven't had time to try it out myself, but a work around should be
> to upgrade to Java 1.5 or to run the jvm in interpreted mode, ie with the
> argument -Xint. Both should produce a stack trace.
>
> --
> Fredrik Jonson
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: StackOveflowError in slow message consumer, why?

Posted by Fredrik Jonson <fr...@myrealbox.com>.
I wrote:

> The strange thing is that sometimes, say every two minutes or so, I saw
> a warning from the message listener, that it could not process a message
> due to a StackOverflowError. 
>
> 2006-07-07 15:51:12,336  WARN [JmsSessionDispatcher: 1]
> (ActiveMQMessageConsumer.java:464) org.activemq.ActiveMQMessageConsumer -
> could not process message: ACTIVEMQ_OBJECT_MESSAGE: [...]
> Reason: java.lang.StackOverflowError java.lang.StackOverflowError

Just a small followup on myself here. 

I was a bit surprised that the StackOverflowError didn't produce an stack
trace. After a bit of research I suspect that it is an bug in the Sun 1.4.2
library. I haven't had time to try it out myself, but a work around should be
to upgrade to Java 1.5 or to run the jvm in interpreted mode, ie with the
argument -Xint. Both should produce a stack trace.

-- 
Fredrik Jonson