Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5D563F822 for ; Mon, 29 Apr 2013 17:51:46 +0000 (UTC) Received: (qmail 26581 invoked by uid 500); 29 Apr 2013 17:51:45 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 26553 invoked by uid 500); 29 Apr 2013 17:51:45 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 26545 invoked by uid 99); 29 Apr 2013 17:51:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Apr 2013 17:51:45 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of christian.posta@gmail.com designates 209.85.215.48 as permitted sender) Received: from [209.85.215.48] (HELO mail-la0-f48.google.com) (209.85.215.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Apr 2013 17:51:39 +0000 Received: by mail-la0-f48.google.com with SMTP id eo20so5699962lab.35 for ; Mon, 29 Apr 2013 10:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=9yd22FdHoUPWm9wv7uQrcPAvQyz6DlsJ3ONX32LruWQ=; b=tpihbPVfao5tYvfyv68HxpJzL9MapZtVchCyUyX7X5MT1UPmWpslKKKCqEQFtKJxor 9ssWV9wMA1eV7PnZJjzuKL/XYn5K+zu+azumYOkO/hE/xDA6w7CU0YSAJpQuAP/Pl5F7 eCSdlctvrFDLOoTwub0fZGomHcKT0zqfwZJpC8lElDiIuTAa9DJPWvU32WM2GSdO4Urj 1HT1oVdJh3DMepa4s+IVanDHUb0X5+vGwX7D+2AMmE/e7Eb8DNWtXCIubUIWesG6zZKe 8XzBeOETFsZiW4OjyREebamv3zsYOM9TDPSxhbV7v7jHIaJvj+ABniMdp7cpiB01XBf7 U5lQ== MIME-Version: 1.0 X-Received: by 10.112.61.6 with SMTP id l6mr26985608lbr.57.1367257879289; Mon, 29 Apr 2013 10:51:19 -0700 (PDT) Received: by 10.114.96.194 with HTTP; Mon, 29 Apr 2013 10:51:19 -0700 (PDT) In-Reply-To: References: Date: Mon, 29 Apr 2013 10:51:19 -0700 Message-ID: Subject: Re: Issue when receiving java object From: Christian Posta To: "users@activemq.apache.org" Content-Type: multipart/alternative; boundary=e89a8f3badc93626b804db8388ea X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f3badc93626b804db8388ea Content-Type: text/plain; charset=ISO-8859-1 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. 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 --e89a8f3badc93626b804db8388ea--