2 Replies Latest reply: Feb 2, 2012 5:40 PM by pavan reddy - oracle RSS

    Message Driven EJB is unable to connect to the JMS destination

    896064
      Hi,
      I have created the following MDB:

      package com.wipro;

      import javax.ejb.ActivationConfigProperty;
      import javax.ejb.MessageDriven;
      import javax.ejb.MessageDrivenContext;
      import javax.jms.JMSException;
      import javax.jms.Message;
      import javax.jms.MessageListener;
      import javax.jms.TextMessage;


      /**
      * Message-Driven Bean implementation class for: MessageBean
      *
      */

      @MessageDriven(mappedName = "MDB")
                
      public class Msb implements MessageListener {

      /**
      * Default constructor.
      */
      public Msb() {
      // TODO Auto-generated constructor stub
      }
      private MessageDrivenContext mdc;
           
           /**
      * @see MessageListener#onMessage(Message)
      */
      public void onMessage(Message message) {
      // TODO Auto-generated method stub
           TextMessage tmsg = null;
           try {
                tmsg = (TextMessage) message;
                //logger.info("MESSAGE BEAN: Message received: " + tmsg.getText( ));
                     System.out.println("MESSAGE BEAN: Message Recieved:" + tmsg.getText( ));
                System.out.println ("The onMessage() is called");
                } catch (JMSException e) {
                e.printStackTrace( );
                mdc.setRollbackOnly( );
                }
                catch (Throwable th) {
                th.printStackTrace();
                }
                }

      }


      When this MDB is deployed on weblogic server 10.3 it shows the following error:

      <Jan 13, 2012 9:35:58 AM IST> <Warning> <EJB> <BEA-010096> <The Message-Driven E
      JB: Msb is unable to connect to the JMS destination or bind to JCA resource adap
      ter: MDB. Connection failed after 63 attempts. The MDB will attempt to reconnect
      /rebind every 10 seconds. This log message will repeat every 600 seconds until the condition clears.>

      <Jan 13, 2012 9:35:58 AM IST> <Warning> <EJB> <BEA-010061> <The Message-Driven E
      JB: Msb is unable to connect to the JMS destination: MDB. The Error was:
      weblogic.jms.common.JMSSecurityException: Access denied to resource: type=<jms>,
      application=oms_jms_module, destinationType=queue, resource=Queue-1, action=receive

      MDB is not able to access Queue????????????