4 Replies Latest reply on Jan 24, 2011 10:15 AM by Martin Husted Hartvig

    Installing into JBoss 4.2.3 GA

    Martin Husted Hartvig Newbie



      Looking at the documentation pages I found little on the matter of installing the jboss-ejb3-plugin into JBoss 4.2.3 GA. We need to update as we have a setup where one JBoss connect to a RemoteJMSProvider on a other JBoss. On the 'client' instance we run a MDB which are setup using ejb3 annotations. Due to the fact that JBossMQ is no longer maintained we started using JBoss Messagning, and changed by following this:




      (Note that this document doesn't tells much of updating ejb3)


      If the JBoss with the RemoteJMSProvider is running as we start the 'client', there are no problem, but when the if the 'server' is down a "javax.management.InstanceNotFoundException: jboss.mq:service=DestinationManager is not registered." is thrown... I'll post the exception below... I found this "http://www.java2s.com/Open-Source/Java-Document/EJB-Server-JBoss-4.2.1/ejb3/org/jboss/ejb3/jms/DestinationManagerJMSDestinationFactory.java.htm" where you in line 68 try to lookup the jboss.mq:service=DestinationManager from inside of the ejb3 part. I found your 1.0.8 installation looking in your pages of http://www.jboss.org/ejb3/ejb3_4-x_docs.html  and looking at the code I found that it have been corrected to use the right destination manager. I'm not sure if can you tell me how to upgrade or if I should download the sources of JBoss 4.2.3 and make the changes needed.






      javax.management.InstanceNotFoundException: jboss.mq:service=DestinationManager is not registered.

              at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:523)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:653)
              at org.jboss.ejb3.JmxClientKernelAbstraction.invoke(JmxClientKernelAbstraction.java:44)
              at org.jboss.ejb3.jms.DestinationManagerJMSDestinationFactory.createDestination(DestinationManagerJMSDestinationFactory.java:75)
              at org.jboss.ejb3.mdb.MessagingContainer.createTemporaryDestination(MessagingContainer.java:573)
              at org.jboss.ejb3.mdb.MessagingContainer.createDestination(MessagingContainer.java:512)
              at org.jboss.ejb3.mdb.MessagingContainer.innerCreateTopic(MessagingContainer.java:471)
              at org.jboss.ejb3.mdb.MessagingContainer.jmsCreate(MessagingContainer.java:395)
              at org.jboss.ejb3.mdb.MessagingContainer.innerStart(MessagingContainer.java:166)
              at org.jboss.ejb3.mdb.MessagingContainer.start(MessagingContainer.java:152)
              at org.jboss.ejb3.mdb.MDB.start(MDB.java:126)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
              at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
              at $Proxy0.start(Unknown Source)

        • 1. Re: Installing into JBoss 4.2.3 GA
          Jaikiran Pai Master

          The EJB3 plugin is not  meant for AS 4.2.x. Infact, work on EJB3 related code in AS 4.x was stopped long back. There have been numerous changes in EJB3 code in AS-5 and the plugin is applicable only to AS-5 versions.


          As for the specific issue, the options you have is to upgrade to AS-5.1.0 and use the plugin or fix the code by downloading the AS source code. I would recommend upgrading to AS-5.1.0

          • 2. Re: Installing into JBoss 4.2.3 GA
            Martin Husted Hartvig Newbie

            Thanks for your reply... well, I have ended up by changing the ejb3 parts of JBoss 4.2.3 as all our production servers are running that version. And now it act as I want... I will see if we can get some process on the shift to the newer version as you say. It's not a good idea to get left back in a old version.




            • 3. Re: Installing into JBoss 4.2.3 GA
              Federico Tejera Newbie

              Hello, I am in the same situation as you where on March, I am migrating the implementation of jms from jboss mq to jboss messaging in a jboss 4.2.x

              My difference with you is that the error appears when I am starting the second server before I had problems with de data base and I restart one of them. If I start both servers in normal conditions I don’t have any problems.

              But, if I analyse the error and code I must have the same problem as you because I use EJB3 in jboss 4.2.x and with jboss messaging.


              Could you say me witch changes did you did with de class DestinationManagerJMSDestinationFactory?


              So thanks.

              • 4. Re: Installing into JBoss 4.2.3 GA
                Martin Husted Hartvig Newbie

                Hi Federico,


                This is the changes I made:



                   public void createDestination(Class<? extends Destination> type, String jndiSuffix) throws Exception


                      String methodName;

                      String destinationContext;

                      if (type == Topic.class)


                         destinationContext = "topic";

                         methodName = "deployTopic";


                      else if (type == Queue.class)


                         destinationContext = "queue";

                         methodName = "deployQueue";




                         // type was not a Topic or Queue, bad user

                         throw new IllegalArgumentException

                                 ("Expected javax.jms.Queue or javax.jms.Topic: " + type);



                      String jndiName = (new StringBuilder()).append(destinationContext).append("/").append(jndiSuffix).toString();

                      ObjectName destinationManagerName = new ObjectName("jboss.messaging:service=ServerPeer");


                      KernelAbstraction kernel = KernelAbstractionFactory.getInstance();

                      // invoke the server to create the destination

                      Object result = kernel.invoke(destinationManagerName,


                              new Object[]{jndiSuffix, jndiName},

                              new String[]{"java.lang.String", "java.lang.String"});





                Rebuild the project and drop the jar into the depoly/ejb3.deployer folder. Hope this helps you...