tibco.ems.illegalstateexception illegal use of receive() from multiple threads

来源:互联网 发布:长得像女生知乎 编辑:程序博客网 时间:2024/06/05 03:54

http://eai.ittoolbox.com/groups/technical-functional/tibco-l/error-when-attempting-to-receive-a-message-4632560

Hi All,
Can you please just why I get this error always?
This error occur too oftenly and I had to restart our Tibco service to fix this issue.

Is this error due to heavy load on TIBCO Service or Is our TIBCO loosing connection with EMS?

Here is the log which I see in Admin console.
There was an error when attempting to receive a message.javax.jms.IllegalStateException: Illegal use of receive() from multiple threads at com.tibco.tibjms.TibjmsxSessionImp._receive(Tibjms xSessionImp.java:1892) at com.tibco.tibjms.TibjmsMessageConsumer._receive(Ti bjmsMessageConsumer.java:240) at com.tibco.tibjms.TibjmsMessageConsumer.receive(Tib jmsMessageConsumer.java:440) at com.tibco.plugin.jms.JMSAbstractGetMessageActivity $JMSMessageGetter.getEvent(JMSAbstractGetMessageAc tivity.java:926) at com.tibco.plugin.jms.JMSAbstractGetMessageActivity $JMSMessageGetter.run(JMSAbstractGetMessageActivit y.java:799)

Here is one possible explanation:
jms session and derived objects (message consumers,message producers) are not supposed to be used by many thread concurrently.
This is what might happen in your application and result is this IlegalState exception at the end.
Maybe jms sender is invoked after one message is delivered by jms receiver. And jms sender does use same Connection (and same session) as jms receiver.
Or a Get Message is performed using same Connection (and same session)
make activities Jms sender /Get Message be synchronized using a lock/critical section.
This will ensure one thread at a time use the jms object.

Other suggestion: increase value of parameter MaxSessions of process starter Jms receiver

 

0 0