• 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

weblogic.jms. common.JMSException: Error deserializing object

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to put my own Serializable objects into a Topic.

I have a message driven bean listening on this and in the method onMessage, i try to cast the object received to the Serializable object sent.

I get the following error

weblogic.jms.common.JMSException: Error deserializing object
at weblogic.jms.common.ObjectMessageImpl.getObject(ObjectMessageImpl.jav
a:144)
at DbLoggerBean.doLogging(DbLoggerBean.java:71)
at LoggerBean_8hiuxq_EOImpl.doLogging(LoggerBean_8hiuxq_EOImpl.java:45)
at LoggerBean_8hiuxq_EOImpl_CBV.doLogging(Unknown Source)
at MessageListenerBean.onMessage(MessageListenerBean.java:54)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:382)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.spi.LoggingEvent
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
Loader.java:198)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClass
Loader.java:223)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at weblogic.jms.common.ObjectMessageImpl$ObjectInputStream2.resolveClass
(ObjectMessageImpl.java:305)


In my client program that publishes messages to a topic, the code looks like this

Result result = new Result();
result.setXXX();
........
logger.info( rslt);

I use the JMSAppender provided by the Log4j.

In my MDB, I write like this...


if (message instanceof ObjectMessage)
{
ObjectMessage m = (ObjectMessage) message;
Result rslt = (Result) m.getObject();
}


I get the Error deserializing object error at the line where i try to getObject() abd cast it to Result.

I use WebLogic 8.1.

Any help in this regard is appreciated.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pri Vij,

From the looks of the stack trace your server code cannot find the org.apache.log4j.spi.LoggingEvent class. Do you have this class in the classpath of your server? I have never used the log4j JMSAppender but it looks to me like your server is going to need this class in order to deserialize the object.

later,
andy
reply
    Bookmark Topic Watch Topic
  • New Topic