• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JMSException in onMessage()

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are there other exceptions in the logs besides javax.jms.JMSException: com.test.TestClass ?
 
Ranjani Sivaraman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

E Armitage wrote:Are there other exceptions in the logs besides javax.jms.JMSException: com.test.TestClass ?



no im not getting any other exception
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JAR file that contains com.test.TestClass is available on the server? Exactly where is it?
 
Ranjani Sivaraman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Testclass is available on ear file
reply
    Bookmark Topic Watch Topic
  • New Topic