Question

I have a Java application which subscribes to a JMS topic application that occasionally thows the following exception :

javax.jms.JMSException: Connection has been terminated
at com.tibco.tibjms.Tibjmsx.buildException(Tibjmsx.java:470)
at com.tibco.tibjms.TibjmsConnection._onDisconnected(TibjmsConnection.java:1946)
at com.tibco.tibjms.TibjmsxLinkTcp$LinkReader.work(TibjmsxLinkTcp.java:314)
at com.tibco.tibjms.TibjmsxLinkTcp$LinkReader.run(TibjmsxLinkTcp.java:250)

I've been handed this piece of code after it's been untouched for 2 years. My JMS knowledge is very limited. It's maven-ized, but it has no reference to any tibco libraries whatsoever. I'm trying to understand how it's possible to get tibco exceptions when there's no reference of tibco in the codebase?

I do see however a system variable set called LD_LIBRARY_PATH which points to some tibco libraries.

Can someone experienced with JMS shell some light as to what might be happening here? Searching the codebase shows that there aint no tibco imports, only javax.jms.

Is it possible that they're somehow wrapped with LD_LIBRARY_PATH using jni or something?

Was it helpful?

Solution

The JMS standard is an API standard. Applications written using the standard do not need to reference the classes from any particular JMS implementation. Instead JNDI is used to obtain a connection factory (example). The intention being that the JMS implementation used can be changed though configuration, rather than having to change code.

In regards to the LD_LIBRARY_PATH, EMS uses JNI and the LD_LIBRARY_PATH is needed, so the EMS jar used by your application can find the native library.

OTHER TIPS

Connection has been terminated

Is does not mean your jms code has some issues just, EMS server is cutting the connection because of some other issues like heartbeat issues etc.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top