2 Replies Latest reply on Mar 6, 2006 3:46 PM by Pedro Torres

    remote queue

    Pedro Torres Newbie

      I'm using:
      JVM - 1.4.2_08
      JBoss - 4.0.2 on Linux

      I'm having a problem trying to make a Session Bean send a JMS message to a queue deployed in another host with another instance of JBoss with the same versions.

      How can a declare de queue remote?

      I'm declaring the queue on ejb-jar.xml as fowlling:


      <ejb-name>NCRequestCommandSender</ejb-name>
      <local-home>br.com.dm.nossacaixa.business.facade.sender.CommandSenderLocalHome</local-home>
      br.com.dm.nossacaixa.business.facade.sender.CommandSenderLocal
      <ejb-class>br.com.dm.nossacaixa.business.facade.sender.CommandSenderBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      <resource-env-ref>
      <resource-env-ref-name>jms/ncrequest</resource-env-ref-name>
      <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
      </resource-env-ref>


      I've already done a MDB consume messages from a remote queue, but I could find documentation about Sessions Beans.

        • 1. Re: remote queue
          jaikiran pai Master

           

          I'm having a problem trying to make a Session Bean send a JMS message to a queue deployed in another host with another instance of JBoss with the same versions


          What's the problem? Do you see any exceptions? If yes, then post the stack trace.

          Make sure that while looking up the remote queue, you are intializing the IntialContext properly to point to the remote machine.
          Make sure that the following properties are set, while creating the Initial context:

          Context.PROVIDER_URL=jnp://remoteServerName:1099
           Context.INITIAL_CONTEXT_FACTORY=org.jnp.interfaces.NamingContextFactory
           Context.URL_PKG_PREFIXES=org.jboss.naming:org.jnp.interfaces


          • 2. Re: remote queue
            Pedro Torres Newbie

            I fixed the problem changing the JNDI names.
            When the queue is remote you don't declare it neither in ejb-jar.xml nor in jboss.
            instead of:
            Factory: java:/XAConnectionFactory
            queue name: java:comp/env/jms/ncrequest
            urlprovider: hostname:1099

            use:
            Factory: ConnectionFactory
            queue name: queue/ncresponse
            urlprovider: jnp://hostname:1099