2 Replies Latest reply on Jul 23, 2003 1:45 PM by Andrew Boyd

    Works in 3.0.2. 3.2.1 MessageFormatException: Object cannot

    Andrew Boyd Novice

      I'm getting the following exception in 3.2.1:
      javax.jms.MessageFormatException: Object cannot be serialized
      at org.jboss.mq.SpyObjectMessage.setObject(SpyObjectMessage.java:67)
      at org.jboss.mq.SpySession.createObjectMessage(SpySession.java:245)
      at com.unetworks.psa.dataminer.DMAsyncPublisher.publishMessage(DMAsyncPublisher.java:47)

      Source for DMAsyncPublisher:
      public void publishMessage(DMAsyncCommandMessage msg){
      svLocator_ = ServiceLocator.getInstance();
      } catch(ServiceLocatorException e){
      // Lookup the managed connection factory for a topic
      QueueConnectionFactory queueFactory = svLocator_.getDataminerQueueConnectionFactory();

      // Create a connection to the JMS provider
      QueueConnection queueConnection = queueFactory.createQueueConnection("admin", "unetworks");

      // Create a topic session
      QueueSession session = queueConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);

      // Lookup the destination you want to send to
      Queue queue = svLocator_.getDataminerQueue();

      // Create a sender
      QueueSender queueSender = session.createSender(queue);

      // Create a message
      ObjectMessage message = session.createObjectMessage(msg);

      // Send the message
      queueSender.send(queue, message); <<< line 47

      Source for DMAsyncCommandMessage:
      public interface DMAsyncCommandMessage extends Serializable{
      void execute(DMAsyncHandlerMDB dmAsyncHandlerMDB);
      Source for implementing class:
      public class DMUrlConceptCommandMessage implements DMAsyncCommandMessage, Serializable{
      private DMUrlConceptMap payload_;
      private SearchResultLineItemList lineItems_;

      The messages are clearly marked as Serializable and it worked fine in 3.0.2. does anyone have any ideas?