Atomikos Forum

JMS session issue with proxy classloading in tomcat

We are developing a web application to be deployed in tomcat7 which uses spring-jms and spring-transactions in combination with atomikos to handle messaging and database actions in one transaction.

We use tibco EMS as messaging provider. The tibco jms library is deployed in TOMCAT_HOME/lib. The spring (4.2.0) libraries are deployed in the web application.

On startup of our web application it will start listening to a queue. At that point the following error is observed:

2015-08-17 13:35:09 DEBUG DefaultMessageListenerContainer:399 - Initiating transaction rollback on listener exception
java.lang.IllegalAccessError: class com.tibco.tibjms.$Proxy108 cannot access its superinterface com.tibco.tibjms.TibjmsS
ession
        at java.lang.reflect.Proxy.defineClass0(Native Method)
        at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:613)
        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:690)
        at com.atomikos.util.ClassLoadingHelper.newProxyInstance(ClassLoadingHelper.java:78)
        at com.atomikos.util.ClassLoadingHelper.newProxyInstance(ClassLoadingHelper.java:117)
        at com.atomikos.jms.AtomikosJmsXaSessionProxy.newInstance(AtomikosJmsXaSessionProxy.java:82)
        at com.atomikos.jms.AtomikosJmsConnectionProxy.invoke(AtomikosJmsConnectionProxy.java:176)
        at com.sun.proxy.$Proxy99.createSession(Unknown Source)
        at org.springframework.jms.support.JmsAccessor.createSession(JmsAccessor.java:192)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.access$200(AbstractPollingMessageLis
tenerContainer.java:75)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer$MessageListenerContainerResourceFact
ory.createSession(AbstractPollingMessageListenerContainer.java:494)
        at org.springframework.jms.connection.ConnectionFactoryUtils.doGetTransactionalSession(ConnectionFactoryUtils.ja
va:315)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingM
essageListenerContainer.java:278)
        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMes
sageListenerContainer.java:233)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(D
efaultMessageListenerContainer.java:1150)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLo
op(DefaultMessageListenerContainer.java:1142)
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessa
geListenerContainer.java:1039)


This error seems to occur because the superinterface com.tibco.tibjms.TibjmsSession is located in the tomcat global lib directory and is 'package private'. The superinterface is therefore loaded by a classloader different from the webapp classloader. The dynamically generated class com.tibco.tibjms.$Proxy102 is generated by atomikos (I assume) and loaded by the webapp classloader which results in the error.

My question is whether it is possible to configure the class loading behavior of atomikos such that it will load the proxy class with the classloader of the superinterface.
Huub Sepers Send private email
Monday, August 17, 2015
 
 
Hi,

You would need to configure Atomikos at the Tomcat level as well. This is supported in our commercial edition, if you have a budget for support...

Thanks
Guy Pardon Send private email
Sunday, September 13, 2015
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics