3 Replies Latest reply on Dec 20, 2007 11:47 PM by P Duffy

    Connecting MDB to remote topic

    P Duffy Newbie

       

      Must connect EJB3 MDB in server X to remote topic on server Y.
      
      First confirmed that server Y is up and topic deployed (via JMXConsole to Y).
      
      I added a Remote provider to deploy/jms-ds.xml on server X.
      
       <!-- Remote JMS provider -->
       <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider,server=remotehost">
       <attribute name="ProviderName">RemoteJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
       <!-- The connection factory -->
       <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
       <!-- The queue connection factory -->
       <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
       <!-- The topic factory -->
       <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
       <!-- Connect to JNDI on the host "the-remote-host-name" port 1099-->
       <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jnp.interfaces
       java.naming.provider.url=10.86.147.208:1099
       </attribute>
       </mbean>
      
      Annotations on the topic listener MDB as below (running on server X).
      
      
      @MessageDriven(activationConfig = {
       @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
       @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/edgeGroupRequestTopic"),
       @ActivationConfigProperty(propertyName = "providerAdapterJNDI", propertyValue="java:/RemoteJMSProvider"),
       @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "60"),
       // TBD: need ability to setup selector at installation/configuration time.
       @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "EDU_ID IN ('ALL', 'EDU_0001')")})
      
      AS startup on server X gives the following error when MDB tries to connect to remote topic (typical of a JNDI problem?).
      
      
      2007-12-19 18:58:37,342 WARN [org.jboss.ejb3.mdb.MessagingContainer] Could not find the topic destination-jndi-name=/topic/edgeGroupRequestTopic
      2007-12-19 18:58:37,342 WARN [org.jboss.ejb3.mdb.MessagingContainer] destination not found: topic/topic/edgeGroupRequestTopic reason: javax.naming.NameNotFoundException: topic not bound
      2007-12-19 18:58:37,342 WARN [org.jboss.ejb3.mdb.MessagingContainer] creating a new temporary destination: topic/topic/edgeGroupRequestTopic
      2007-12-19 18:58:37,358 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:ear=mdpe-1.0-SNAPSHOT.ear,jar=eduRequestRouter-ejb-1.0-SNAPSHOT.jar,name=EDURequestRouterMDB,service=EJB3
      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:557)
       at org.jboss.ejb3.mdb.MessagingContainer.createDestination(MessagingContainer.java:496)
      
      
      What am I doing wrong?
      
      
      --------------------
      
      Further DEBUG turned up...llosk like the DefaultJMSProvider is being used tot he remote lookup instead of RemoteJMSProvider?
      
      
      
      2007-12-20 11:51:08,744 DEBUG [org.jboss.ejb3.mdb.MessagingContainer] Initializing
      2007-12-20 11:51:08,744 DEBUG [org.jboss.ejb3.mdb.MessagingContainer] Looking up provider adapter: java:/DefaultJMSProvider
      2007-12-20 11:51:08,744 DEBUG [org.jboss.ejb3.mdb.MessagingContainer] Provider adapter: org.jboss.jms.jndi.JNDIProviderAdapter@1781288
      2007-12-20 11:51:08,744 DEBUG [org.jboss.ejb3.mdb.MessagingContainer] context: javax.naming.InitialContext@e8a298
      2007-12-20 11:51:08,744 DEBUG [org.jboss.ejb3.mdb.MessagingContainer] Got destination type Topic for EDURequestRouterMDB
      2007-12-20 11:51:08,744 DEBUG [org.jboss.ejb3.mdb.MessagingContainer] jndiSuffix: topic/edgeGroupRequestTopic
      2007-12-20 11:51:08,744 WARN [org.jboss.ejb3.mdb.MessagingContainer] Could not find the topic destination-jndi-name=/topic/edgeGroupRequestTopic
      2007-12-20 11:51:08,744 WARN [org.jboss.ejb3.mdb.MessagingContainer] destination not found: topic/topic/edgeGroupRequestTopic reason: javax.naming.NameNotFoundException: topic not bound
      2007-12-20 11:51:08,744 WARN [org.jboss.ejb3.mdb.MessagingContainer] creating a new temporary destination: topic/topic/edgeGroupRequestTopic
      2007-12-20 11:51:08,759 DEBUG [org.jboss.ejb3.mdb.MdbDelegateWrapper] Starting failed jboss.j2ee:ear=mdpe-1.0-SNAPSHOT.ear,jar=eduRequestRouter-ejb-1.0-SNAPSHOT.jar,name=EDURequestRouterMDB,service=EJB3
      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)
      
      
      
      
      [
      code]

        • 1. Re: Connecting MDB to remote topic
          Andy Taylor Master

          Are you running with JbossMessaging or JBossMQ, this is the JBossMessaging forum.

          It looks to me as if JBossMQ is not deployed properly. There should be an mbean deployed in one of the service files, i think its hsqldb-jdbc2-service.xml in the default configuration. it would look similar to

          <mbean code="org.jboss.mq.server.jmx.DestinationManager" name="jboss.mq:service=DestinationManager">
           <depends optional-attribute-name="MessageCache">jboss.mq:service=MessageCache</depends>
           <depends optional-attribute-name="PersistenceManager">jboss.mq:service=PersistenceManager</depends>
           <depends optional-attribute-name="StateManager">jboss.mq:service=StateManager</depends>
           <depends optional-attribute-name="ThreadPool">jboss.mq:service=ThreadPool</depends>
           <depends>jboss:service=Naming</depends>
           </mbean>
          


          Post on the JBossMQ forum if you are running withMQ.

          • 2. Re: Connecting MDB to remote topic
            P Duffy Newbie

            We're using JBoss Messaging

            • 3. Re: Connecting MDB to remote topic
              P Duffy Newbie

              False alarm. All the settings are correct. We had a build problem