[jboss-user] [EJB3] - can't find message-driven bean..

Joseph Hwang do-not-reply at jboss.com
Sun Dec 25 04:11:32 EST 2011


Joseph Hwang [http://community.jboss.org/people/aupres] created the discussion

"can't find message-driven bean.."

To view the discussion, visit: http://community.jboss.org/message/643136#643136

--------------------------------------------------------------
I make codes Message-Driven Bean on JBoss 7 and Eclipse Indigo.
Architecture is

JMSTestEAR
        |
        |--JMSTestEJB (contains Message-Driven Bean)
        |
        |--JMSTestWeb (contains jsp which calls Message-Bean)

And Codes are

==================Message Driven Bean =====================

@MessageDriven(
  activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
      @ActivationConfigProperty(propertyName = "destination", propertyValue = "*queue/testQueue*") })
public class MDBean implements MessageListener {
    public MDBean() {
        // TODO Auto-generated constructor stub
    }
 
    public void onMessage(Message message) {
        // TODO Auto-generated method stub
     TextMessage m = (TextMessage) message;
     try {
        System.out.println(m.getText());
     } catch (JMSException e) {
       e.getMessage();
     }
   }
}
=============== JSP ============
........
<body>
<%
 try {
    Context ctx = new InitialContext();
    Queue queue = (Queue) ctx.lookup("queue/testQueue"); *//throws Exception* 
    QueueConnectionFactory qcf = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
    QueueConnection conn = qcf.createQueueConnection();
    QueueSession qs = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
    TextMessage msg = qs.createTextMessage("Hi !");
    QueueSender sender = qs.createSender(queue);
    sender.send(msg);
 } catch (Exception e) {
    out.println(e.getMessage());
 }
%>
</body>
....

Deploymemts are successful. ear , jar and war are deployed. But JSP throws exception below:

   queue/testQueue -- service jboss.naming.context.java.queue.testQueue

Is ejb3 jar deployment succeeded? or do i miss any process in deploying message-driven bean?
I need your advice! Thanks in advance..

Best regards.
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/643136#643136]

Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111225/6fb8a5e3/attachment-0001.html 


More information about the jboss-user mailing list