4 Replies Latest reply on May 31, 2006 7:00 PM by Rob Hadfield

    Can't configure an MDB to a remote destination

    Rob Hadfield Newbie

      I've been trying to configure a simple MDB to use a remote destination as described in this wiki page -> http://wiki.jboss.org/wiki/Wiki.jsp?page=HowDoIConfigureAnMDBToTalkToARemoteQueue
      I can see the naming lookup done on port 1099 to the remote server, but then the MDB is bound to a local destination of the same name, or if I remove this queue from the local configuration, I get

      2006-05-31 12:04:30,091 WARN [org.jboss.ejb.plugins.jms.JMSContainerInvoker] JMS provider failure detected for RemoteQueue
      org.jboss.deployment.DeploymentException: Error during queue setup; - nested throwable: (javax.jms.InvalidDestinationException: The destination QUEUE.RemoteQueue does not exist !)

      The remote queue is set up and has messages ready to deliver; There just seems to be a missing link somewhere. The wiki page mentioned above only references the queuehost in the JNDI lookup. Is is really that simple? Why won't it work for me!

      I've tried this with 4.0.2 and 4.0.4. The MDB works fine when configured for a local queue. Does anyone have a working example of remote mdb that they can share, or a moment to enlighten me as to what I've missed out?

        • 1. Re: Can't configure an MDB to a remote destination
          jaikiran pai Master

          Well i do have it working without any issues. In my case the remote queue is named queueOn2177 and is deployed on the remote server using the following entry in jbossmq-destinations-service.xml file:

          <mbean code="org.jboss.mq.server.jmx.Queue"
           <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>

          Then on my local machine, i have configured my MDB to look up this remote queue, by configuring the same in 3 files, namely ejb-jar.xml, jboss.xml and jms-ds.xml as follows:





          <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
           <!--this name will be used in jboss.xml-->
           <attribute name="ProviderName">MyJMSProvider</attribute>
           <!--Points to remote server-->
           <attribute name="ProviderUrl">jnp://ps2177:1099</attribute>
           <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JBossMQProvider</attribute>
           <attribute name="QueueFactoryRef">UIL2XAConnectionFactory</attribute>
           <attribute name="TopicFactoryRef">UIL2XAConnectionFactory</attribute>



          • 2. Re: Can't configure an MDB to a remote destination
            Oliver Nelson Newbie

            where do you put those three files? in the META-INF directory of the project?
            my problem is that my mdb does not listen to incoming messages,
            so maybe i forgot a descriptive file like yours so that it is not deployed correctly.

            - jboss 4.0.4GA
            - jboss-messaging-1.0.1.CR2
            - jboss-EJB-3.0_RC6-PFD

            when i deploy the mdb example i'm able to connect and send messages from a remote system, they're processed by the MDBExample mdb.

            • 3. Re: Can't configure an MDB to a remote destination
              Rob Hadfield Newbie

              Thanks jaikiran, I solved the problem although I'm not happy about it! In my jms-ds.xml I had specified:

              <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>

              which is how the DefaultJMSProvider is configured. When I changed this to

              <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>

              as in your post, it magically works! So I don't understand why these references should be different.

              I rechecked server.log (trace is enabled for org.jboss.jms) but there was no indication of a problem with the reference.

              Nevertheless my remote MDB now works which is a *great* relief... 8-) Thanks again.

              • 4. Re: Can't configure an MDB to a remote destination
                Rob Hadfield Newbie

                Hi obn,

                In my configuration my ejb jar file looks like this:


                jms-ds.xml is in your JBossHome/server/*configuration*/deploy/jms

                It sounds like you have another MDB (MDBExample) listening to the same queue...