1 Reply Latest reply on Jan 12, 2011 9:15 AM by topizio

    Issue with HA JNDI and Singleton MDB

    topizio

      Hi guys,

       

          I'm trying to build an develop environment with two JBoss AS in cluster mode balanced via Apache mod_jk to deploy an EAR application with two WAR and two MDBs in HA mode.

       

      Unfortunately something goes wrong because when one server is online the application run correctly. When the second server enter in the cluster it's unable to reach the MDBs defined in the master node. Every time I've got the exception javax.naming.NameNotFoundException: queue not bound.

       

      As the guide said I left untouched the jndi.properties and I've changed the jboss.xml for Engine MDB as the follows:

       

      <jboss>

         <enterprise-beans>

            <message-driven>

               <ejb-name>Engine</ejb-name>

               <resource-ref>

                   <res-ref-name>queue/Engine</res-ref-name>

                   <jndi-name>jnp://localhost:1100/queue/Engine</jndi-name>

               </resource-ref>

            </message-driven>

         </enterprise-beans>

         <resource-managers>

         </resource-managers>

      </jboss>

       

       

      and ejb-jar.xml as the follows:

       

      <ejb-jar >

         <description><![CDATA[No Description.]]></description>

         <display-name>Engine</display-name>

         <enterprise-beans>

            <message-driven >

               <description><![CDATA[Bean to access messages]]></description>

               <display-name>Engine</display-name>

               <ejb-name>Engine</ejb-name>

               <ejb-class>com.web.ejb.engine.EngineBean</ejb-class>

               <transaction-type>Bean</transaction-type>

               <acknowledge-mode>Auto-acknowledge</acknowledge-mode>

               <message-driven-destination>

                  <destination-type>javax.jms.Queue</destination-type>

               </message-driven-destination>

               <resource-ref>

                   <res-type>javax.jms.Queue</res-type>

                   <res-ref-name>queue/Engine</res-ref-name>

                   <res-auth>Container</res-auth>

               </resource-ref>

            </message-driven>

         </enterprise-beans>

         </assembly-descriptor>

      </ejb-jar>

       

      I've done something similiar for the descriptors for the other MDB.

       

      I've tried to query the service JNDIView in jmx-console and HA-JNDI Namespace is still empty.

       

      Have somebody got any idea?

       

      Thanks a lot for your attention.

       

       

      Best regards

        • 1. Issue with HA JNDI and Singleton MDB
          topizio

          Hi guys,

           

              I've just change the ejb-jar.xml as

           

          <jboss>

             <enterprise-beans>

                <message-driven>

                   <ejb-name>ServiceHandler</ejb-name>

                   <destination-jndi-name>queue/ServiceHandler</destination-jndi-name>

                   <resource-ref>

                       <res-ref-name>queue/ServiceHandler</res-ref-name>

                       <jndi-name>jnp://${jboss.bind.address}:1100/queue/ServiceHandler</jndi-name>

                   </resource-ref>

                </message-driven>

             </enterprise-beans>

             <resource-managers>

             </resource-managers>

          </jboss>

           

          and added in jndi.properties those two lines:

           

          java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory

          java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

          java.naming.provier.url=host1:1100,host2:1100

          jnp.disableDiscovery=true

           

           

          and now the queues seems to work perfectly.

           

          This configurasion work for JBoss Application Server 4.2.3 on Windows 2008 and two servers with different network subnet.

           

          Thanks you anyway.