aspose file tools*
The moose likes JBoss/WildFly and the fly likes JMSException in onMessage() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JMSException in onMessage() " Watch "JMSException in onMessage() " New topic
Author

JMSException in onMessage()

Ranjani Sivaraman
Greenhorn

Joined: May 29, 2012
Posts: 6
hi
im trying to send object through jms queue..
<code>
public void onMessage(Message queuemessage) {
try {
if (queuemessage instanceof ObjectMessage) {
ObjectMessage Objmsg = (ObjectMessage) queuemessage;
System.out.println(((ObjectMessage)queuemessage).getJMSDestination());
System.out.println(((ObjectMessage)queuemessage).getJMSMessageID());
Object objectData = ((ObjectMessage)queuemessage).getObject(); // i'm getting exception in this line
if (objectData instanceof TestClass) {
TestClass s1 = (TestClass) objectData;
System.out.println("Reading message s1: " +s1.getEid());
}

</code>

TestClass implements java.io.Serializable. im using jboss-6.0.0.final
im not getting this exception when i sent String object.
How to get testclass object???

Exception:
17:39:58,209 ERROR [STDERR] javax.jms.JMSException: com.test.TestClass

17:39:58,209 ERROR [STDERR] at java.net.URLClassLoader$1.run(Unknown Source)

17:39:58,209 ERROR [STDERR] at java.net.URLClassLoader$1.run(Unknown Source)

17:39:58,209 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)

17:39:58,209 ERROR [STDERR] at java.net.URLClassLoader.findClass(Unknown Source)

17:39:58,209 ERROR [STDERR] at java.lang.ClassLoader.loadClass(Unknown Source)

17:39:58,209 ERROR [STDERR] at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

17:39:58,209 ERROR [STDERR] at java.lang.ClassLoader.loadClass(Unknown Source)

17:39:58,209 ERROR [STDERR] at java.lang.Class.forName0(Native Method)

17:39:58,209 ERROR [STDERR] at java.lang.Class.forName(Unknown Source)

17:39:58,209 ERROR [STDERR] at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:284)

17:39:58,209 ERROR [STDERR] at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1152)

17:39:58,210 ERROR [STDERR] at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:886)

17:39:58,210 ERROR [STDERR] at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505)

17:39:58,219 ERROR [STDERR] at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450)

17:39:58,219 ERROR [STDERR] at java.lang.ClassLoader.loadClass(Unknown Source)

17:39:58,219 ERROR [STDERR] at java.lang.Class.forName0(Native Method)

17:39:58,219 ERROR [STDERR] at java.lang.Class.forName(Unknown Source)

17:39:58,219 ERROR [STDERR] at java.io.ObjectInputStream.resolveClass(Unknown Source)

17:39:58,219 ERROR [STDERR] at org.hornetq.utils.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:69)

17:39:58,219 ERROR [STDERR] at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)

17:39:58,220 ERROR [STDERR] at java.io.ObjectInputStream.readClassDesc(Unknown Source)

17:39:58,220 ERROR [STDERR] at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)

17:39:58,220 ERROR [STDERR] at java.io.ObjectInputStream.readObject0(Unknown Source)

17:39:58,220 ERROR [STDERR] at java.io.ObjectInputStream.readObject(Unknown Source)

17:39:58,220 ERROR [STDERR] at org.hornetq.jms.client.HornetQObjectMessage.getObject(HornetQObjectMessage.java:158)

17:39:58,220 ERROR [STDERR] at com.test.Sender.onMessage(Sender.java:91)

17:39:58,220 ERROR [STDERR] at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:91)

17:39:58,221 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:822)

17:39:58,221 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:46)

17:39:58,221 ERROR [STDERR] at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:940)

17:39:58,221 ERROR [STDERR] at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)

17:39:58,221 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

17:39:58,221 ERROR [STDERR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

17:39:58,221 ERROR [STDERR] at java.lang.Thread.run(Unknown Source)
E Armitage
Rancher

Joined: Mar 17, 2012
Posts: 892
    
    9
Are there other exceptions in the logs besides javax.jms.JMSException: com.test.TestClass ?
Ranjani Sivaraman
Greenhorn

Joined: May 29, 2012
Posts: 6
E Armitage wrote:Are there other exceptions in the logs besides javax.jms.JMSException: com.test.TestClass ?


no im not getting any other exception
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

The JAR file that contains com.test.TestClass is available on the server? Exactly where is it?


JBoss In Action
Ranjani Sivaraman
Greenhorn

Joined: May 29, 2012
Posts: 6
thanks for your reply..

i have gone through the discussions in the link https://issues.jboss.org/browse/AS7-1271

i found this issue can be solved by commenting


in war-deployers-jboss-beans.xml file

or

changing the classloader programatically.



above option is not working for me..

I have tried the first one. After made changes in war-deployers-jboss-beans.xml i tried to debug..when it

reaches onmessage() method debug pop stands in Daemon Thread [http-127.0.0.1-8080-1] (Stepping)

In the variable dialog its showing [toString() unavailable - no suspended threads] for all the variables. I could not debug further.

There is no stack trace on the console..Previously jmsexception was displayed on the console.

I reverted the changes in war-deployers-jboss-beans.xml ..I reinstalled the jboss. still everytime i debug

i'm getting the same.. please tel what could be the cause for it?

I couldn't proceed further..
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5842
    
    7

Why are you modifying the classloader mechanism? You should not have to do that.

Please answer the questions I originally asked. And remove any configuration changes or code related to classloading.

Ranjani Sivaraman
Greenhorn

Joined: May 29, 2012
Posts: 6
Testclass is available on ear file
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMSException in onMessage()