0 Replies Latest reply on Jan 31, 2006 2:55 PM by henry fan

    MDB in EJB3.0 is not called

    henry fan Newbie

      I am new to use ejb3.0' message bean in jboss. I am creating a pojo client as producer and write a ejb MDB to receive the messages, but it looks like producer working fine, there are not any exception come out, but the OnMessage method in my MBD .
      is never called, I am not sure if i missed something? do I need extra configure file? if any,how to do it, appreciated very much.

      here is producer codes:

      try {
      Context ctx = new InitialContext();
      Object object = ctx.lookup("ConnectionFactory");
      QueueConnectionFactory factory = (QueueConnectionFactory)object;
      Queue que = (Queue) ctx.lookup("queue/myQueue");
      QueueConnection connect = factory.createQueueConnection();
      QueueSession session= connect.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
      QueueSender sender = session.createSender(que);
      MapMessage message = session.createMapMessage();
      catch (Exception e) {
      e.printStackTrace ();

      here is MDB codes:

      @MessageDriven(activateConfig ={
      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
      @ActivationConfigProperty(propertyName="destination", propertyValue="queue/myQueue"),
      @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "AUTO_ACKNOWLEDGE"),
      @ActivationConfigProperty(propertyName = "durability", propertyValue = "Durable")
      public class TestMDB implements MessageListener {
      public void onMessage(Message message) {
      System.out.println("------Received message------");