[jboss-user] [Beginners Corner] - problem with class loader

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


HI 

 I am new to JBoss and EJB development. I am stuck at one point for 2 days now, I had been searching example documents but could not get any help so trying to get soem help from forums.

Am trying to write a simple message driven bean (ejb 2.1 spec) and am using jboss 4.2.3 and eclipse 3.4 IDE on windows vista OS.

I have implmented a ben class and have also implemented javax.ejb.MessagDrivenBean abd javax.jms.MessageListener in my class. But when I deploy the ejb to the server I see that the server log shows an error. And it says can not find class MessageListener. It further says that the EJB code has to implement the MessageListener intergface which I did. I have pasted my code here could any one please let me know what the problem might be ????


  | 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=4175640#4175640

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



More information about the jboss-user mailing list