Class Loading Issue with HornetMQ and JBoss 7.0.2
ashok_94 Feb 9, 2012 12:08 AMHi All,
I am working on a JBoss 7.0.2 instance. Our app is a war and messages are dropped into the queue. This works fine. But when we read it via a listener, the system throws an exception. It is looking for a class which is present in the WEB-INF/classes.
I understand that the module classloader (if i am right it is HornetMQ) is not able to see this application class and throwing up. I dont want my application class to be part of the server lib. That class living within the war is the best place.
The exception is : javax.jms.JMSException: com.yyy.TransportMessage from [Module "org.hornetq:main" from local module loader @238b8914 (roots: /Users/xxx/jboss/multi/jboss-as-7.0.2.Final/modules)]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361) at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:603)
at org.hornetq.utils.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:71) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at org.hornetq.jms.client.HornetQObjectMessage.getObject(HornetQObjectMessage.java:158) at com.xxx.MessageReceiver.handleObjectMessage(NSMessageReceiver.java:72)
at com.xxx.jms.JMSListener.onMessage(JMSListener.java:1540) at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:91)
What should i do to make this work. thanks a lot in advance for the help
regards
ashok