1 Reply Latest reply on May 19, 2004 1:07 AM by adrian.brock

    Creating custom javax.jms.Message class

      Hi,

      I have

      public interface EmailMessage extends TextMessage
      {
      private String from;
      private String to;
      private String subject;

      // getter setter follows
      }

      then i have

      public class EmailMessageImpl extends com.sun.jms.TextMessageImpl implements EmailMessage
      {
      ...
      ...
      }


      Now, in my SLSB, when i write
      EmailMessage em = new EmailMessageImpl();

      Jboss gives me error on runtime, NoClassDefFoundError - EmailMessageImpl.

      I have checked it's in my ejb jar. And i tested calling constructor from another class. That works.

      So, i check the TextMessageImpl. It has empty public constructor. Then i checked com.sun.jms.MessageImpl also has empty constructor.

      Now, in API terms, you create message from Queue/TopciSession,

      Do i have to extend QueueSession and add createEmailMessage()?
      OR
      Do i have to extend TextMessageImpl of Jboss's SpyMQ i.e. SpyTextMessage (if i am not wrong)


      Please correct me if am thinking in totally wrong direction.



      I have made my code working by switiching to MapMessage as of now but i would really like a custom jms message.