1 Reply Latest reply on May 13, 2002 7:21 PM by Hiram Chirino

    SpyObjectMessage error on getObject()

    vinjh Newbie

      This doesn't look good at all:
      I'm trying to send a message and in the server it goes all well, but in the client throws me an ugly error: in the onMessage() method, where I'm checking whether the message is an ObjectMessage object:
      if (msg instanceof javax.jms.ObjectMessage).
      The peculiar thing is that, although it goes in the IF, there, when I try the getObject() method, gives me this error:

      [INFO,Default] ErrorMessage : [Message Exception : javax.jms.MessageFormatException: IOException] : orig message : can not show Message : javax.jms.MessageFormatException: IOException

      A getClass() reveals that the msg (which is supposed to be a javax.msg.ObjectMessage) is in the JBoss viewed as
      org.jboss.mq.SpyObjectMessage - and this IN the IF that checkes wheter it is an ObjectMessage.
      As I couldn't find doc on the SpyObjectMessage class, can somebody help me with this? (I tried also with the classLoader in the current thread and it didn't help ).
      Thank you for answering.

        • 1. Re: SpyObjectMessage error on getObject()
          Hiram Chirino Expert

          ObjectMessage is an interface that SpyObjectMessage implements. So. don't worry, SpyObjectMessage is a ObjectMessage.

          The problem is that the ObjectMessage holds a serialized object that cannot be unserialized. Probably because the class cannot be loaded by the classloader that the MDB is using. Try putting the jar that has the class that is being carried by the ObjectMessage in the ear file that the MDB was deployed with.