2 Replies Latest reply on Feb 10, 2005 5:20 PM by Adrian Brock

    Remote Producers

    Victor Lewis Newbie

      I am using JBoss 4.0.1 on Win2k with J2SE 1.4.2.

      I have read the FAQ, Read Me First and Read Me Second. I have also searched this and other forums but have been unable to figure out what I am doing wrong.

      I have MDB which consumes messages from one queue and produce messages for another. While I am able to get the MDBs to consume off a remote queue they are unable to find the remote queues to which I wish to publish.

      What I have done:

      Added the following to my jms-ds.xml on the remote host:

       <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       <attribute name="ProviderName">PromJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">
       <!-- The combined connection factory -->
       <attribute name="FactoryRef">XAConnectionFactory</attribute>
       <!-- The queue connection factory -->
       <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
       <!-- The topic factory -->
       <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
       <attribute name="Properties">
       <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
       <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/PromJMSProvider</config-property>

      Added this to my login-config.xml on the remote host:

       <application-policy name = "PromJmsXARealm">
       <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
       flag = "required">
       <module-option name = "principal">guest</module-option>
       <module-option name = "userName">guest</module-option>
       <module-option name = "password">guest</module-option>
       <module-option name = "managedConnectionFactoryName">jboss.jca:service=TxCM,name=PromJmsXA</module-option>

      As I mentioned the MDBs are receiving messages from the remote queues but for completeness here is the change I made to message-driven-bean (I want all MDBs on this server to use remote queues):
       <!-- WARN: Don't set this to zero until a bug in the pooled executor is fixed -->

      Here is the jboss.xml for one of the remote MDBs


      I then get this exception:

      javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: JobsAnswers not bound]

      on the line in which I attempt to get the destination I whish to send messages to:

      Destination destination = (Destination)jndiContext.lookup("java:comp/env/jms/Answers");

      I am really at a loss as to what to try next. Might someone please help.

      Thank You,

        • 1. Re: Remote Producers
          Adrian Brock Master

          It is not surpising you couldn't find anything in the JMS FAQ or WIKI.
          This is not a JMS Question, it is an EJB/jndi question.

          Is your queue deployed locally? I think not.



          The resource-ref knows nothing about the JMSProvider.
          The JMSProvider is used to configure the jms resource adaptor and mdb inbound processing.
          A resource-ref is used to configure generic jndi references.

          Since it is remote, you must provide the full url.

          Please also read the manual about the Naming MBeans that JBoss provides
          to allow jndi federation, and the naming documentation in general

          Feel free to write up a simple example on the WIKI.

          • 2. Re: Remote Producers
            Adrian Brock Master

            Perhaps you would care to have a go at implementing
            this simplified version of the ExternalContext mbean that is
            targetted towards your use case?