# JMS Reader exception connecting to JBoss messaging queue

**URL:** <https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925>\
**Category:** CloverDX Platform\
**Created:** [September 8, 2011, 12:00am UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925 "2011-09-08T00:00:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranusuri](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@ranusuri](https://forum.cloverdx.com/u/ranusuri)\
**Post date:** [September 8, 2011, 12:00am UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925/1 "2011-09-08T00:00:00Z")

</div>

Hi,

I am trying to create a JMS Reader to read messages from a queue defined in my JBoss server 5.1 GA

JMS config -  
name=  
destId=queue/TestQueue  
username=guest  
providerUrl=jnp\://hostIP\:1099  
connectionFactory=ConnectionFactory  
libraries=/opt/GateIn-3.1.0/client/jboss-logging-spi.jar;/opt/GateIn-3.1.0/client/jboss-messaging-client.jar;/opt/GateIn-3.1.0/client/jboss-mdr.jar;/opt/GateIn-3.1.0/client/jboss-aop-client.jar  
iniCtxFactory=org.jnp.interfaces.NamingContextFactory  
password=guest

Following is the error stack trace when executing the graph.

ERROR [WatchDog] - Graph pre-execute initialization failed.  
Element [1315455928228:JMSINF]-Pre-Execution of connection [JmsConnection0] failed.  
at org.jetel.graph.TransformationGraph.preExecute(TransformationGraph.java:484)  
at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:196)  
at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:64)  
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)  
at java.util.concurrent.FutureTask.run(FutureTask.java:166)  
at java.lang.Thread.run(Thread.java:636)  
Caused by: Cannot establish JMS connection (null)  
at org.jetel.connection.jms.JmsConnection.initConnection(JmsConnection.java:395)  
at org.jetel.connection.jms.JmsConnection.preExecute(JmsConnection.java:359)  
at org.jetel.graph.TransformationGraph.preExecute(TransformationGraph.java:481)

I wrote a client java program in eclipse and executed it to create and send a message. It worked without issues.

Java test program -

queue = (Queue)JNDIHelper.getReference(“queue/TestQueue”);  
connFactory = (ConnectionFactory)JNDIHelper.getReference(“ConnectionFactory”);  
Connection connection = connFactory.createConnection(“guest”, “guest”);  
Session session = connection.createSession(false, Session.AUTO\_ACKNOWLEDGE);

MessageProducer producer = session.createProducer(queue);  
MessageConsumer consumer = session.createConsumer(queue);  
connection.start();  
TextMessage message = session.createTextMessage(“This is a test message.”);  
producer.send(message);

Please help me debug this issue. Is there some configuration that I am missing for connecting to the server?

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [September 8, 2011, 1:20pm UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925/2 "2011-09-08T13:20:27Z")

</div>

Hello,  
Is it the whole error message? Try to run the graph without checking the configuration (_-skipcheckcofig_ option), then full error stack trace should be printed out.  
I was able to create a JMSconnection within the same jvm in Jboss, but I was not able to connect from a standalone client (CloverETL Designer).  
If you are able to write a valid connection in java, you can create your JMS connection object that overrides _org.jetel.connection.jms.JmsConnection_ and integrate it to your CloverETL:

- Write object overriding _org.jetel.connection.jms.JmsConnection_ - you need to override _init()_ and _preExecute()_ methods

- write _plugin.xml_ file (see attached file: this is plugin description file for _org.jetel.connection_ standard plugin)

- place the _plugin.xml_ and your binaries to CloverETL plugin directory (something like _\<cloveretl\_designer\_home\_directory\>/plugins/com.cloveretl.gui\_X.X.X/lib/plugins_

- [plugin.xml](https://cdn.cloverdx.com/forum/417%5F518a48c310845ad7342ae198c66d4c21/plugin.xml)

---

<div class="post-metadata">

**Author:** ![ranusuri](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@ranusuri](https://forum.cloverdx.com/u/ranusuri)\
**Post date:** [September 8, 2011, 8:41pm UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925/3 "2011-09-08T20:41:07Z")

</div>

Here is the full stack trace with -skipcheckconfig option

ERROR [WatchDog] - Graph pre-execute initialization failed.  
Element [1315455928228:JMSINF]-Pre-Execution of connection [JmsConnection0] failed.  
at org.jetel.graph.TransformationGraph.preExecute(TransformationGraph.java:484)  
at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:196)  
at org.jetel.graph.runtime.WatchDog.call(WatchDog.java:64)  
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)  
at java.util.concurrent.FutureTask.run(FutureTask.java:166)  
at java.lang.Thread.run(Thread.java:636)  
Caused by: Cannot establish JMS connection (null)  
at org.jetel.connection.jms.JmsConnection.initConnection(JmsConnection.java:395)  
at org.jetel.connection.jms.JmsConnection.preExecute(JmsConnection.java:359)  
at org.jetel.graph.TransformationGraph.preExecute(TransformationGraph.java:481)  
… 5 more  
Caused by: org.jboss.jms.exception.MessagingNetworkFailureException  
at org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(DelegateSupport.java:263)  
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:191)  
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate\_N3019492359065420858.invokeTarget(ClientConnectionFactoryDelegate$createConnectionDelegate\_N3019492359065420858.java)  
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)  
at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:81)  
at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect\_z\_handleCreateConnectionDelegate\_22948154.invoke(StateCreationAspect\_z\_handleCreateConnectionDelegate\_22948154.java)  
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)  
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)  
at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)  
at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)  
at org.jetel.connection.jms.JmsConnection.initConnection(JmsConnection.java:393)  
… 7 more  
Caused by: org.jboss.remoting.InvocationFailureException: Unable to perform invocation; nested exception is:  
java.io.IOException: org.jboss.remoting.InvocationResponse  
at org.jboss.remoting.transport.socket.SocketClientInvoker.handleException(SocketClientInvoker.java:142)  
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:891)  
at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.transport(BisocketClientInvoker.java:426)  
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:165)  
at org.jboss.remoting.MicroRemoteClientInvoker.establishLease(MicroRemoteClientInvoker.java:467)  
at org.jboss.remoting.Client.setupClientLease(Client.java:1715)  
at org.jboss.remoting.Client.connect(Client.java:1615)  
at org.jboss.remoting.Client.connect(Client.java:515)  
at org.jboss.jms.client.remoting.JMSRemotingConnection$1.run(JMSRemotingConnection.java:354)  
at java.security.AccessController.doPrivileged(Native Method)  
at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:350)  
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:158)  
… 16 more  
Caused by: java.io.IOException: org.jboss.remoting.InvocationResponse  
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)  
at java.security.AccessController.doPrivileged(Native Method)  
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)  
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)  
at java.lang.Class.forName0(Native Method)  
at java.lang.Class.forName(Class.java:264)  
at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:179)  
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1592)  
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1513)  
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1749)  
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1346)  
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:368)  
at org.jboss.jms.wireformat.SerializedPacket.read(SerializedPacket.java:73)  
at org.jboss.jms.wireformat.JMSWireFormat.read(JMSWireFormat.java:298)  
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.versionedRead(MicroSocketClientInvoker.java:1222)  
at org.jboss.remoting.transport.socket.MicroSocketClientInvoker.transport(MicroSocketClientInvoker.java:850)  
… 26 more

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [September 9, 2011, 6:33am UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925/4 "2011-09-09T06:33:39Z")

</div>

I’ve got the same stack trace :-(. It seems, that it is impossible to connect to remote JMS queue on Jboss, with java sun api ([Getting Started with Java Message Service (JMS)](http://java.sun.com/developer/technicalArticles/Ecommerce/jms/Getting%20Started%20with%20Java%20Message%20Service%20%28JMS%29)). But if you are able to write the working connection it is easy to integrate it to CloverETL (similar as [Step by Step Component building](http://wiki.cloveretl.org/doku.php?id=component%5Fbuilding)). You can download java source of CloverETL (with org.jetel.connection.jms.JmsConnection) from [Sourceforge](http://sourceforge.net/projects/cloveretl/files/cloveretl.engine/rel-3-1-0/cloverETL.src.rel-3-1-0.zip/download).

---

<div class="post-metadata">

**Author:** ![ranusuri](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@ranusuri](https://forum.cloverdx.com/u/ranusuri)\
**Post date:** [September 9, 2011, 6:44am UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925/5 "2011-09-09T06:44:11Z")

</div>

Is this a limitation or bug with Desktop edition?  
Will the remote JMS connection work with the Server Edition? or Should I go ahead and use the custom code for JMSConnection and use that?

---

<div class="post-metadata">

**Author:** ![ranusuri](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@ranusuri](https://forum.cloverdx.com/u/ranusuri)\
**Post date:** [September 9, 2011, 7:31am UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925/6 "2011-09-09T07:31:47Z")

</div>

Hi Agata,

I was looking over the source code and the line number where the exception was being thrown. Looks to me that the factory object used in the initConnection() method might be null and it is not getting created.  
I was also wondering as to why the init() method is not called and instead the initConnection() method is called. If init() method was called prior to creating the connection, we might be able to see initial context, factory object and other variables initialized.

Could you please help me understand if I am reading the code wrong or is there something missing as to how it is called or instantiated?

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [September 9, 2011, 7:37am UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925/7 "2011-09-09T07:37:51Z")

</div>

Hello,  
I’ve tested the CLoverETL JMS connection on CloverETL Server on Jboss 5.1. It worked fine, when I sent/read messages from the Queue defined on the same application server, but I was not able to connect from stand alone CloverETL Designer. I’ve googled a lot, but haven’t found a solution. I’ll try to search more.  
If you would like to try CloverETL Server please write to [sales@cloveretl.com](mailto:sales@cloveretl.com). You can get a trial version for one month.

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [September 9, 2011, 8:02am UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925/8 "2011-09-09T08:02:26Z")

</div>

Hello,  
_init()_ method of _org.jetel.connection.jms.JmsConnection_ is called from _init()_ method of _org.jetel.graph.TransformationGraph_. The design is proper as it works within the same jvm and with other app servers. I believe it is an issue with class loading as when I add all jars from jboss client folder, the connection is established on the beginning, but the the graph fails:

```auto
INFO [WatchDog] - Pre-execute initialization of connection:
DEBUG [WatchDog] - SocketClientInvoker[38d460, bisocket://127.0.0.1:4457] setting client socket wrapper class name to org.jboss.jms.client.remoting.ClientSocketWrapper
DEBUG [WatchDog] - SocketClientInvoker[38d460, bisocket://127.0.0.1:4457] setting shouldCheckConnection to false
DEBUG [WatchDog] - SocketClientInvoker[38d460, bisocket://127.0.0.1:4457] setting timeout to 0
DEBUG [WatchDog] - SocketClientInvoker[38d460, bisocket://127.0.0.1:4457] constructed
DEBUG [WatchDog] - SocketClientInvoker[38d460, bisocket://127.0.0.1:4457] setting client socket wrapper class name to org.jboss.jms.client.remoting.ClientSocketWrapper
DEBUG [WatchDog] - SocketClientInvoker[38d460, bisocket://127.0.0.1:4457] setting shouldCheckConnection to false
DEBUG [WatchDog] - SocketClientInvoker[38d460, bisocket://127.0.0.1:4457] setting timeout to 0
DEBUG [WatchDog] - Setting ping frequency to: 214748364
DEBUG [WatchDog] - SocketClientInvoker[38d460, bisocket://127.0.0.1:4457] connecting
DEBUG [WatchDog] - Creating semaphore with size 50
DEBUG [WatchDog] - SocketClientInvoker[38d460, bisocket://127.0.0.1:4457] connected
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] setting maxPoolSize to 200
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] setting client socket wrapper class name to org.jboss.jms.client.remoting.ClientSocketWrapper
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] setting shouldCheckConnection to false
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] setting timeout to 0
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] constructed
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] setting maxPoolSize to 200
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] setting client socket wrapper class name to org.jboss.jms.client.remoting.ClientSocketWrapper
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] setting shouldCheckConnection to false
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] setting timeout to 0
DEBUG [WatchDog] - Setting ping frequency to: 214748364
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] connecting
DEBUG [WatchDog] - Creating semaphore with size 200
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] connected
DEBUG [WatchDog] - SocketClientInvoker[1248979, bisocket://127.0.0.1:4457] got exception: ClientSocketWrapper[Socket[addr=/127.0.0.1,port=4457,localport=37870].70c38c]
java.io.IOException: org.jboss.remoting.InvocationResponse
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	]at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
	at java.lang.Class.forName0(Native Method)
.
.
.
.

```

Note the line:

```auto
	]at java.security.AccessController.doPrivileged(Native Method)

```

---

<div class="post-metadata">

**Author:** ![ranusuri](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@ranusuri](https://forum.cloverdx.com/u/ranusuri)\
**Post date:** [September 13, 2011, 8:55pm UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925/9 "2011-09-13T20:55:23Z")

</div>

Thank you Agata. We are in the process of procuring the server edition. Will test on that and check if it is working.

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [September 22, 2011, 12:48pm UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925/10 "2011-09-22T12:48:38Z")

</div>

I have a good news: the JMSConnection from standalone CloverETL Designer to JBoss server works fine in 3.1.2 version (RC in the time being - release is planned for the beginning of October). There was really the problem with class-loading and it is resolved by usage of proper class loader when creating _javax.jms.Connection_ object.

---

<div class="post-metadata">

**Author:** ![ranusuri](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@ranusuri](https://forum.cloverdx.com/u/ranusuri)\
**Post date:** [September 22, 2011, 12:51pm UTC](https://forum.cloverdx.com/t/jms-reader-exception-connecting-to-jboss-messaging-queue/925/11 "2011-09-22T12:51:47Z")

</div>

Thank you Agata for the information. We procured the Server edition. Haven’t tried it out yet. Having trouble deploying on JBoss application server with oracle as persisitence layer.

Will try out the 3.1.2 version when it is out.
