[jboss-user] [EJB/JBoss] - class loader exception

devireddy do-not-reply at jboss.com
Wed Sep 10 12:53:35 EDT 2008


Hi 

 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 {	} 
  | @Override	
  | public void onMessage(Message msg)	
  | {		
  | try
  | {	
  | 	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();		}		
  | }	
  | 
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4175650#4175650

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4175650



More information about the jboss-user mailing list