1 Reply Latest reply on Sep 11, 2008 2:44 AM by jaikiran pai

    class loader exception

    Rajasekhar Devi Reddy Newbie


      I am new to Jboss and to ejb development. I am stuck at a point for two days now. searched online examples and didnt get any thing so trying to find help in forums.

      I am trying to get a message driven bean(ejb 2.1) to work. my environment is jboss 4.2.3 eclipse IDE 3.4 on vista.

      I have implemented the bean class and have implemented two necessary interfaces javax.jms.MessageListener and javax.ejb.MessageDrivenBean. But when I deploy my bean to the server, I see a log file error message saying class loader did not find MessageListener class. It further tells me that ejb should implement MessageListener interface which I did. Can soem one let me know what the probliem might be ?

      Here is my bean class

      import java.util.Properties;
      import javax.ejb.EJBException;
      import javax.ejb.MessageDrivenBean;
      import javax.ejb.MessageDrivenContext;
      import javax.jms.Message;
      import javax.jms.MessageListener;
      import javax.jms.Queue;import javax.jms.QueueConnection;
      import javax.jms.QueueConnectionFactory;
      import javax.jms.QueueReceiver;
      import javax.jms.QueueSession;
      import javax.jms.TextMessage;
      import javax.naming.InitialContext;
      import org.jboss.logging.Logger;
      public class MessageBean implements MessageListener, MessageDrivenBean
      public MessageBean() { }
      public void ejbCreate(){ }
      public void ejbRemove() throws EJBException { }
      public void setMessageDrivenContext(MessageDrivenContext arg0) throws EJBException { }
      public void onMessage(Message msg)
       TextMessage txt = (TextMessage)msg;
       Logger log=Logger.getLogger("Message BEan log"); log.info(txt.getText()); System.out.println("MessageBean has received this message:"+txt.getText());
      catch(Exception e) { e.printStackTrace(); }