2 Replies Latest reply on Jul 14, 2011 10:43 AM by Burkhard Vogel

    MDB Problem:=DestinationManager not Registeres => InstanceNo

    Marc Reis Novice

      Hi,
      I have written a very simple MDB for testing purpose. I am running two 4.0.4GA servers clustered. My MDB is part of an ear.
      The problem occurs when I start both servers simultaneously, starting sequentially does not produce this error.

      The first error message shows up on the "second started server". Not sure why it can?t find the queue...

      2006-09-21 18:22:42,603 WARN [org.jboss.ejb3.mdb.MDB] Could not find the queue
       destination-jndi-name=queue/mdb
      2006-09-21 18:22:42,643 WARN [org.jboss.ejb3.mdb.MDB] destination not found: q
      ueue/mdb reason: javax.naming.NameNotFoundException: queue not bound
      2006-09-21 18:22:42,644 WARN [org.jboss.ejb3.mdb.MDB] creating a new temporary
       destination: queue/mdb
      2006-09-21 18:22:42,648 WARN [org.jboss.system.ServiceController] Problem star
      ting service jboss.j2ee:ear=CLUSTERINGEAR.ear,jar=CLUSTERINGEJB.jar,name=MDBean
      ,service=EJB3
      javax.management.InstanceNotFoundException: jboss.mq:service=DestinationManager
       is not registered.
       at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegist
      ry.java:523)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:653)
       at org.jboss.ejb3.mdb.MDB.createDestination(MDB.java:671)
       at org.jboss.ejb3.mdb.MDB.innerCreateQueue(MDB.java:407)
       at org.jboss.ejb3.mdb.MDB.innerCreate(MDB.java:347)
       at org.jboss.ejb3.mdb.MDB.innerStart(MDB.java:225)
       at org.jboss.ejb3.mdb.MDB.start(MDB.java:214)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
      .java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
      ssorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWr
      apper.java:99)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBean
      Support.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceM
      BeanSupport.java:245)
      ...
      

      Ending with an incomplete deployment:
      ...
      2006-09-21 18:22:48,638 ERROR [org.jboss.deployment.scanner.URLDeploymentScanne
      r] Incomplete Deployment listing:
      
      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:ear=CLUSTERINGEAR.ear,jar=CLUSTERINGEJB.jar,name=MDBean,
      service=EJB3
       State: FAILED
       Reason: javax.management.InstanceNotFoundException: jboss.mq:service=Destinat
      ionManager is not registered.
      ...
      


      When I now shut down the "first server" the second keeps throwing this error:
      2006-09-21 18:32:02,791 WARN [org.jboss.mq.Connection] Connection failure, use
       javax.jms.Connection.setExceptionListener() to handle this error and reconnect
      org.jboss.mq.SpyJMSException: Exiting on IOE; - nested throwable: (java.io.EOFE
      xception)
       at org.jboss.mq.SpyJMSException.getAsJMSException(SpyJMSException.java:
      78)
       at org.jboss.mq.Connection.asynchFailure(Connection.java:420)
       at org.jboss.mq.il.uil2.UILClientILService.asynchFailure(UILClientILSer
      vice.java:174)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleStop(SocketManager
      .java:440)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:3
      72)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.io.EOFException
       at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputS
      tream.java:2670)
       at java.io.ObjectInputStream.readByte(ObjectInputStream.java:864)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:3
      17)
       ... 1 more
      
      


      My MDB Client looks like this:
      public class ClientMDB implements Runnable{
      ...
       private void sendMsg(String msg){
       Queue jmsQueue = null;
       QueueConnectionFactory factory = null;
       QueueConnection qCnct = null;
       QueueSession qSess = null;
       QueueSender qSnd = null;
       ExceptionListener qExcLsnr = new MyMDBExceptionListner();
      
       try{
       time = System.currentTimeMillis();
      
       jmsQueue =(Queue) doLookUp("queue/mdb");
       factory = (QueueConnectionFactory) doLookUp("ConnectionFactory");
      
       qCnct = factory.createQueueConnection();
       qCnct.setExceptionListener(qExcLsnr);
       qSess = qCnct.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      
       for(int i=0; i < 2; i++){
       TextMessage txtMsg = qSess.createTextMessage("This is "+Thread.currentThread().getName()+" calling ("+i+")");
       qSnd = qSess.createSender(jmsQueue);
       qSnd.send(txtMsg);
       }
       }catch(Exception e){
       System.out.println(e);
       e.printStackTrace();
       }
       }
      
       private Object doLookUp(String JNDIName){
       doLogin(XXX","xxx");
       try{...
       }catch(Exception e){
       return null;
       }
       }
      
       private void doLogin(String user, String pw){
       ?
       }
       public class MyMDBExceptionListner implements ExceptionListener{
       int cnt = 0;
      
       public void onException(JMSException arg0) {
       // TODO Auto-generated method stub
       cnt++;
       if(cnt>1){
       System.out.println(cnt+" Los of connection to the JMS due to: "+ arg0.getStackTrace().toString());
       }
       }
       }
      }
      
      


      and the MDB like this:
      @MessageDriven(activationConfig =
      { @ActivationConfigProperty(propertyName="destinationType",
       propertyValue="javax.jms.Queue"),
       @ActivationConfigProperty(propertyName="destination",
       propertyValue="queue/mdb")})
      public class MDBean implements MessageListener{
      
       public void onMessage(Message arg0) {
       // TODO Auto-generated method stub
       try{
       TextMessage txtMsg = (TextMessage)arg0;
       String message = txtMsg.getText();
      
       System.out.println("I received a message: "+message);
       txtMsg.acknowledge();
      
       }catch(Exception e){
       System.out.println(e);
       e.printStackTrace();
       }
       }
      }
      
      


      I am thankful for any help !

      Sincerely
      Marc