4 Replies Latest reply on Apr 29, 2009 2:32 AM by Leslie V

    Not able to connect to remote Queue through Bridge

    Jerry Jacob Newbie

      Hi,

      We were trying to setup a Messaging bridge between Jboss SOA platform 4.2.2 and Jboss AS 4.0.4. I have an remote MQ queue running on 4.0.4 server. We are doing this to avoid any incompatability between Jboss Messaging in SOA and MQ in 4.0.4.

      We set the Source as the remote queue running on 4.0.4 and target as a local queue running in SOA platform. But when the bridge configuration is deployed, its throwing the below exception

      2008-07-02 12:02:44,108 WARN [org.jboss.jms.server.bridge.Bridge] Failed to set up connections
      java.lang.NullPointerException
       at javax.naming.InitialContext.getURLScheme(InitialContext.java:228)
       at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:277)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
       at org.jboss.jms.server.bridge.JNDIFactorySupport.createObject(JNDIFactorySupport.java:66)
       at org.jboss.jms.server.bridge.JNDIConnectionFactoryFactory.createConnectionFactory(JNDIConnectionFactoryFactory.java:46)
       at org.jboss.jms.server.bridge.Bridge.createConnection(Bridge.java:832)
       at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:944)
       at org.jboss.jms.server.bridge.Bridge.start(Bridge.java:306)
       at org.jboss.jms.server.bridge.BridgeService.startService(BridgeService.java:346)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      


      Below is excerpts from our hajndi-jms-ds.xml. We are using LocalJMSProvider

      <!-- The JMS provider loader -->
       <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.jms:service=JMSProviderLoader,name=HAJNDIJMSProvider">
       <attribute name="ProviderName">DefaultJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">
       org.jboss.jms.jndi.JNDIProviderAdapter
       </attribute>
       <!-- 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>
       <!-- Access JMS via HAJNDI -->
       <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=${jboss.bind.address:localhost}:1100
       jnp.disableDiscovery=false
       jnp.partitionName=${jboss.partition.name:DefaultPartition}
       jnp.discoveryGroup=${jboss.partition.udpGroup:230.0.0.4}
       jnp.discoveryPort=1102
       jnp.discoveryTTL=16
       jnp.discoveryTimeout=5000
       jnp.maxRetries=1
       </attribute>
       </mbean>
      <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.messaging:service=JMSProviderLoader,name=LocalJMSProvider">
       <attribute name="ProviderName">LocalJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
       <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
       <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
       <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=${jboss.bind.address:localhost}:1100
       </attribute>
       </mbean>
      


      Our bridge config is as below

      <mbean code="org.jboss.jms.server.bridge.BridgeService"
       name="jboss.messaging:service=Bridge,name=IPMBridge"
       xmbean-dd="xmdesc/Bridge-xmbean.xml">
      
       <!-- The JMS provider loader that is used to lookup the source destination -->
       <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider,server=10.200.171.60</depends>
      
       <!-- The JMS provider loader that is used to lookup the target destination -->
       <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=LocalJMSProvider</depends>
      
       <!-- The JNDI lookup for the source destination -->
       <attribute name="SourceDestinationLookup">/queue/SOA_STD</attribute>
      
       <!-- The JNDI lookup for the target destination -->
       <attribute name="TargetDestinationLookup">/queue/IPMQueue</attribute>
      
       <!-- The username to use for the source connection
       <attribute name="SourceUsername">bob</attribute>
       -->
      
       <!-- The password to use for the source connection
       <attribute name="SourcePassword">cheesecake</attribute>
       -->
      


      Below is our remote queue config

      <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider,server=10.200.171.60">
      
       <attribute name="ProviderName">RemoteJMSProvider</attribute>
       <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
      
       <!-- 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>
       <!-- Uncomment to use HAJNDI to access JMS -->
      
       <attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=10.200.171.60:1199
       </attribute>
       </mbean>
      


      Could somebody let us know whats wrong with this configuration? We have gone through other threads which talks about the same issue, but was not that helpful.

      Thanks in advance

        • 1. Re: Not able to connect to remote Queue through Bridge
          Jeff Mesnil Master

           

          "jjacobwip" wrote:
          Hi,

          <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
           name="jboss.messaging:service=JMSProviderLoader,name=LocalJMSProvider">
           <attribute name="ProviderName">LocalJMSProvider</attribute>
           <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
           <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
           <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
           <attribute name="Properties">
           java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
           java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
           java.naming.provider.url=${jboss.bind.address:localhost}:1100
           </attribute>
           </mbean>
          




          One thing you could try is to prepend java:/ to your FactoryRefs.
          e.g.:

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


          hope it helps,
          jeff

          • 2. Re: Not able to connect to remote Queue through Bridge
            Jerry Jacob Newbie

            Thank You. I have tried this, but still getting the same issue.

            My source is a Remote Queue running in Jboss MQ and my target is a local Queue running on Jboss Messaging. To make it more clear, remote queue is running on Jboss 4.0.4 where messaging is Jboss MQ and my bridge is configured on Jboss AS 4.2.0 which is using Jboss Messaging. I am trying to create a bridge between Jboss MQ and Jboss Messaging.

            • 3. Re: Not able to connect to remote Queue through Bridge
              Shailesh P Newbie

              I am also facing the same problem. Have you found the solution for this?

              • 4. Re: Not able to connect to remote Queue through Bridge
                Leslie V Newbie

                Not fully about the issue listed above. But I had an issue a bit similar.
                My messaging setup was working locally.
                But over a network , my client wasn't able to establish a connection
                with my server.

                With lots of googling, trial and error and with help from a friend ,
                I got it working by following these steps :

                • In jboss-5.0.0\server\default\conf\jndi.properties
                  added : java.naming.provider.url=192.168.0.116:1099

                • Changes to
                  jboss-5.0.0\server\default\deploy\messaging\jms-ds.xml

                  Avoided using ${jboss.bind.address} : The value substitution wasn't appearing in this file.


                  DefaultJMSProvider2

                  org.jboss.jms.jndi.JNDIProviderAdapter

                  <!-- The combined connection factory -->
                  java:/XAConnectionFactory
                  <!-- The queue connection factory -->
                  java:/XAConnectionFactory
                  <!-- The topic factory -->
                  java:/XAConnectionFactory
                  <!-- Uncomment to use HAJNDI to access JMS-->

                  java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
                  java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
                  java.naming.provider.url=192.168.0.116:1099



                  <tx-connection-factory>
                  <jndi-name>JmsXA2</jndi-name>
                  <xa-transaction/>
                  <rar-name>jms-ra.rar</rar-name>
                  <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
                  <adapter-display-name>JMS Adapter</adapter-display-name>
                  <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
                  <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider2</config-property>
                  <security-domain-and-application>JmsXARealm2</security-domain-and-application>
                  jboss.messaging:service=ServerPeer
                  </tx-connection-factory>

                  Corresponding changes to jboss-5.0.0\server\default\conf\login-config.xml:

                  <application-policy name="JmsXARealm2">

                  <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=JmsXA2</module-option>
                  </login-module>

                  </application-policy>


                • Bound the address during jboss's startup
                  run.bat -b 192.168.0.116

                • Changed the firewall settings on my XP machine to allow my client to interact with my server.