8 Replies Latest reply on Apr 11, 2008 3:07 AM by akalsy

    topic not bound in HAJMS

    anaholzbach

      Hi,

      We're using JBoss 4.2.0.GA. We have two nodes running a flex-based application that calls some business methods on clustered ejbs, which in turn use JMS to update state on the client. I've setup a named partition (LCSTest) with two nodes, and gave this partition its own multicast address (there are other partitions in the network). The JMS topics are deployed in deploy-hasingleton in both nodes and the nodes are configured to access the same SQL Server datasource for JMS data.

      The beans are annotated as follows:

      @Stateless
      @TransactionManagement
      @Local(BedManagementService.class)
      @Remote(BedManagementService.class)
      public class BedManagementServiceBean implements BedManagementService {
      
       @Resource
       private SessionContext mSessionContext;
      
       @Resource(mappedName = "TopicConnectionFactory")
       private ConnectionFactory mJmsConnectionFactory;
      
       @Resource(mappedName = "topic/RoomService/BedStaffUpdate")
       private Topic mStaffUpdateTopic;
      ...
      
      }


      and jboss.xml has these contents:

      <jboss>
       <enterprise-beans>
       ...
       <session>
       <ejb-name>BedManagementServiceBean</ejb-name>
       <resource-ref>
       <res-ref-name>TopicConnectionFactory</res-ref-name>
       <jndi-name>jnp://${jboss.bind.address:localhost}:1100/TopicConnectionFactory</jndi-name>
       </resource-ref>
       <resource-ref>
       <res-ref-name>topic/RoomService/StaffUpdate</res-ref-name>
       <jndi-name>
       jnp://${jboss.bind.address:localhost}:1100/topic/RoomService/BedStaffUpdate</jndi-name>
       </resource-ref>
       <clustered>True</clustered>
       <cluster-config>
       <partition-name>
       ${jboss.partition.name:DefaultPartition}</partition-name>
       <bean-load-balance-policy>
       org.jboss.ha.framework.interfaces.RoundRobin</bean-load-balance-policy>
       </cluster-config>
       </session>
       </enterprise-beans>
      
      </jboss>


      I've deployed the hajms-examples.jar in a third server to test the two nodes in the cluster, and successfully verified that the setup was working.

      JNDIView lists all the beans in both nodes, but lists the topics only in the singleton master, which makes sense. But the topics are only available in the singleton master. The node that is not the master gets an NameNotFoundException "topic not bound".

      Any suggestions will be much appreciated. Thanks !

      Ana


        • 1. Re: topic not bound in HAJMS
          brian.stansberry

          See http://www.jboss.com/index.html?module=bb&op=viewtopic&t=109219 for a similar problem. I think my analysis of the issue _may_ be a bit off though. Can you post a stack trace of the failure you see?

          • 2. Re: topic not bound in HAJMS
            anaholzbach

            Hi Brian,

            Thanks for the quick reply. That would make sense. Here's the stack trace:

            javax.naming.NameNotFoundException: topic not bound
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
            at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
            at javax.naming.InitialContext.lookup(InitialContext.java:351)
            at flex.messaging.services.messaging.adapters.JMSProxy.getDestination(JMSProxy.java:186)
            at flex.messaging.services.messaging.adapters.JMSTopicConsumer.start(JMSTopicConsumer.java:59)
            at flex.messaging.services.messaging.adapters.JMSAdapter.manage(JMSAdapter.java:345)
            at flex.messaging.services.MessageService.manageSubscriptions(MessageService.java:571)
            at flex.messaging.services.MessageService.serviceCommand(MessageService.java:152)
            at flex.messaging.MessageBroker.routeCommandToService(MessageBroker.java:622)
            at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:298)
            at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(AbstractRTMPServer.java:682)
            at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTMPConnection.java:665)
            at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643)
            at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668)
            at java.lang.Thread.run(Thread.java:595)


            Will do as you say and in the meantime try to come up with a workaround. How hard would it be to implement the getJndiProperties() method in DeploymentUnit to read the properties you mentioned ?

            Thanks again,

            Ana


            • 3. Re: topic not bound in HAJMS
              anaholzbach
              • 4. Re: topic not bound in HAJMS
                brian.stansberry

                This stack trace confuses me. I don't see anything to do with a session bean in it.

                • 5. Re: topic not bound in HAJMS
                  bdecoste

                  I've just checked in a fix for EJBTHREE-975 into Branch_4_2. The changes are being reviewed.

                  • 6. Re: topic not bound in HAJMS
                    akalsy

                    Hey i am also running into a similar issue. Is there any solution for this?

                    • 7. Re: topic not bound in HAJMS
                      brian.stansberry

                      According to the the JIRA, EJBTHREE-975 is fixed in AS 4.2.2.

                      • 8. Re: topic not bound in HAJMS
                        akalsy

                        Thanks a lot Brian for the information.