activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: Issue when receiving java object
Date Mon, 29 Apr 2013 17:51:19 GMT
Is the correct class on the consumer's classpath?
in general, object messages over JMS create lots of headache... might want
to switch to some other formatting... xml, json, etc.


On Sun, Apr 28, 2013 at 8:32 AM, Balachandar R.A.
<balachandar.ra@gmail.com>wrote:

> Hello,
>
> I wanted to send a java object to activeMQ. I could successfully send the
> object but I have a trouble receiving it in the consumer side. I could
> track it is receiving an object message. However, when I tried to assign
> the object message to java object using oobjMsg.getObject() method, i get
> an exception like below
>
> INFO: Establishing connection with activeMQ server tcp://192.168.1.5:61616
> Received one object messsage
> Apr 28, 2013 8:44:34 PM java_util_logging_Logger$severe call
> SEVERE: Exception occurred in PhotoConsumer class..!!
> javax.jms.JMSException: Failed to build body from bytes. Reason:
> java.io.InvalidClassException: org.eads.photo.mosaic.Messag; local class
> incompatible: stream classdesc serialVersionUID = 4856066955488107053,
> local class serialVersionUID = 999
>         at
>
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
>         at
>
> org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQObjectMessage.java:192)
>         at javax.jms.ObjectMessage$getObject.call(Unknown Source)
>         at
>
> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
>         at
>
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
>         at
>
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
>         at
> org.eads.photo.mosaic.consumer.PhotoConsumer.main(PhotoConsumer.groovy:85)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
>         at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
>         at
> groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1318)
>         at
>
> org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:822)
>         at
>
> groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:264)
>         at groovy.lang.GroovyShell.run(GroovyShell.java:220)
>         at groovy.lang.GroovyShell.run(GroovyShell.java:150)
>         at groovy.ui.GroovyMain.processOnce(GroovyMain.java:588)
>         at groovy.ui.GroovyMain.run(GroovyMain.java:375)
>         at groovy.ui.GroovyMain.process(GroovyMain.java:361)
>         at groovy.ui.GroovyMain.processArgs(GroovyMain.java:120)
>         at groovy.ui.GroovyMain.main(GroovyMain.java:100)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:601)
>         at
> org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:106)
>         at
> org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128)
> Caused by: java.io.InvalidClassException: org.eads.photo.mosaic.Messag;
> local class incompatible: stream classdesc serialVersionUID =
> 4856066955488107053, local class serialVersionUID = 999
>         at
> java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:604)
>         at
> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601)
>         at
> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514)
>         at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
>         at
> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347)
>         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
>         at
>
> org.apache.activemq.command.ActiveMQObjectMessage.getObject(ActiveMQObjectMessage.java:185)
>         ... 27 more
>
> Any hint to fix this?
>
> regards
> Bala
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message