10 Replies Latest reply on Aug 28, 2008 1:11 AM by beve

    Could not send ESB message to remote host.

    gloomy

      We trying to send ESB message to remote host computer. We change all the settings from "localhost" to "remote host" in those files:
      1. jboss-properties.xml
      2. jndi.properties
      3. juddi.properties
      4. jbossesb.xml
      And we always get such an error message:

      144094 [main] ERROR couriers.JmsCourier - JMX lookup error.
      javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
       at javax.naming.InitialContext.lookup(Unknown Source)
       at org.jboss.internal.soa.esb.couriers.JmsCourier.createMessageProducer(JmsCourier.java:255)
       at org.jboss.internal.soa.esb.couriers.JmsCourier.deliver(JmsCourier.java:155)
       at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.deliver(TwoWayCourierImpl.java:157)
       at org.jboss.soa.esb.listeners.ListenerUtil.tryToDeliver(ListenerUtil.java:70)
       at quickstart.helloworld.test.SendEsbMessage.main(SendEsbMessage.java:60)
      Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]
       at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:269)
       at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385)
       ... 8 more

      No occurence of our "remote host" in stack trace - only "localhost" here.
      While debugging ESB we obtain that findEPR(...) method always set jndi-URL as "localhost" for every EPR it founds.
      Can you suggest us any solution or workaround please?

      PS: We always set "remote host" by it's IP address, we also check the network connection and found all is OK.

        • 1. Re: Could not send ESB message to remote host.
          tfennelly

          Hi there.

          Can you please confirm exactly what you are suing? ESB version etc..

          Would it be possible for you to post your jbossesb.xml here on this thread please? I'm interested in seeing your <jms-provider> configs? Do they define a jndi-URL attribute?

          • 2. Re: Could not send ESB message to remote host.
            gloomy

            Yes, of course I has such an attribute. You can get all my configs here: http://tests.mipt.ru/wiki/downloads/2007/3/configs-29165518.rar/

            • 3. Re: Could not send ESB message to remote host.
              gloomy

              Sorry, bad link, here are the new one:
              Configs Files

              • 4. Re: Could not send ESB message to remote host.
                kurtstam

                Hi Gloomy,

                I can't open your zip file, but you should *not* have to changing anything to move an ESB service from one host to another. The only thing that would matter is the JNDI information for the jms-provider. Which is why Tom asked for that.

                Cheers,

                --Kurt

                • 5. Re: Could not send ESB message to remote host.
                  gloomy

                  Sorry all again, but I can't agree with Kurt.
                  I use folloeing code to test ESB instance:

                  package quickstart.helloworld.test;
                  
                  import java.util.Collection;
                  
                  import org.jboss.soa.esb.services.registry.Registry;
                  import org.jboss.soa.esb.services.registry.RegistryException;
                  import org.jboss.soa.esb.services.registry.RegistryFactory;
                  
                  public class GetAllServices {
                  
                   /**
                   * @param args
                   */
                   public static void main(String[] args) {
                   Registry registry;
                   try {
                   registry = RegistryFactory.getRegistry();
                   Collection <String> cs = registry.findAllServices();
                   for (String str : cs) {
                   System.out.println(str);
                   }
                   } catch (RegistryException e) {
                   e.printStackTrace();
                   }
                   }
                  
                  }
                  

                  This class write down all the service, registered on ESB instance (as I hope). I try to discribe to you the following situation:
                  1. I has one host without JBoss+ESB running (localhost) and another one host with running JBoss+ESB (winxppro1).
                  2. I'm trying to run helloworld example against not localhost but winxppro1.
                  3. To check that all OK, I'm running above mentioned class on the remotye host (winxppro1) and see that there is no my service (MyCategory:MyName).
                  I'm trying the following steps:
                  a) I'm change only JNDI information in jbossesb.xml
                  b) I'm also change JNDI info and all "localhost" entry in jbossesb-properties.xml
                  But all in vane! Can you please check...


                  • 6. Re: Could not send ESB message to remote host.
                    tfennelly

                    Post your jbossesb.xml here please.

                    • 7. Re: Could not send ESB message to remote host.
                      gloomy

                      Here it is:

                      
                      <?xml version = "1.0" encoding = "UTF-8"?>
                      <jbossesb
                       xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd"
                       parameterReloadSecs="5">
                      
                       <providers>
                       <jms-provider name="JBossMQ"
                       connection-factory="ConnectionFactory"
                       jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
                       jndi-URL="winxppro1">
                      
                       <jms-bus busid="EsbChannel">
                       <jms-message-filter dest-type="QUEUE"
                       dest-name="queue/D" />
                       </jms-bus>
                      
                       </jms-provider>
                       </providers>
                      
                       <services>
                       <service category="HELLO" name="hello"
                       description="TestService">
                       <listeners>
                       <jms-listener name="test" busidref="EsbChannel"
                       maxThreads="1" />
                       </listeners>
                       <actions>
                       <action name="action1"
                       class="quickstart.helloworld.MyJMSListenerAction"
                       process="displayMessage"
                       />
                       </actions>
                       </service>
                       </services>
                      
                      </jbossesb>
                      
                      


                      • 8. Re: Could not send ESB message to remote host.
                        tfennelly

                        OK Gloomy, I ran a few tests here and at least verified that this scenario works on the latest release (4.2MR1).

                        Would it be possible for you to download and try this version of the ESB - it appears as though you're using 4.0.

                        So what I did was the following...

                        1. Deployed a version of the ESB Server (new to 4.2) on Machine1 (192.168.1.6).
                        2. Deployed 2 queues on this machine ("quickstart_helloworld_Request_gw" and "quickstart_helloworld_Request_esb"). See jbm-queue-service.xml below - dropped this into the deploy folder on the ESB Server running on Machine1.
                        3. Deployed another version of the ESB Server locally.
                        4. Modified the "helloworld" quickstart so as to use the remote JMS Provider on Machine1. Note how I renamed the "quickstartGwChannel" and "quickstartEsbChannel" bus queues to "quickstart_helloworld_Request_gw" and "quickstart_helloworld_Request_esb". I did this to make sure I wasn't using the local provider - these queues didn't exist locally.
                        5. Modified the "jbosshome.dir" property in "quickstarts/quickstarts.properties" so as to deploy to my local ESB Server instance.
                        6. Ran "ant deploy" to deploy the quickstart.
                        7. I modified SendJMSMessage.setupConnection() to get it to connect to the JMS Provider on Machine1. This included modifying the hardcoded queue name to "quickstart_helloworld_Request_gw".
                        8. Ran "ant runtest" to test sending the message through the Gateway. Worked :-)
                        9. Ran "ant sendesb" to test sending the message directly to the ESB Aware listener. Worked :-)

                        jbm-queue-service.xml:

                        <?xml version="1.0" encoding="UTF-8"?>
                        <server>
                         <mbean code="org.jboss.jms.server.destination.QueueService"
                         name="jboss.messaging.destination:service=Queue,name=quickstart_helloworld_Request_gw"
                         xmbean-dd="xmdesc/Queue-xmbean.xml">
                         <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                         <depends>jboss.messaging:service=PostOffice</depends>
                         </mbean>
                         <mbean code="org.jboss.jms.server.destination.QueueService"
                         name="jboss.messaging.destination:service=Queue,name=quickstart_helloworld_Request_esb"
                         xmbean-dd="xmdesc/Queue-xmbean.xml">
                         <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
                         <depends>jboss.messaging:service=PostOffice</depends>
                         </mbean>
                        </server>
                        


                        jboss-esb.xml (provider config only):
                         <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
                         jndi-URL="jnp://192.168.1.6:1099" jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
                         jndi-pkg-prefix="org.jboss.naming:org.jnp.interfaces">
                        
                         <jms-bus busid="quickstartGwChannel">
                         <jms-message-filter
                         dest-type="QUEUE"
                         dest-name="queue/quickstart_helloworld_Request_gw"
                         />
                         </jms-bus>
                         <jms-bus busid="quickstartEsbChannel">
                         <jms-message-filter
                         dest-type="QUEUE"
                         dest-name="queue/quickstart_helloworld_Request_esb"
                         />
                         </jms-bus>
                        
                         </jms-provider>
                        


                        • 9. Re: Could not send ESB message to remote host.

                          Hi,

                          I posted a reply to the topic N. 140722 (Still Hello World error) as it seems to have the same root cause. My /samples/quickstarts/helloworld//jboss-esb.xml doesn't have the jndi url you mentioned. My file has these entries:

                          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">

                          <jms-bus busid="quickstartGwChannel">
                          <jms-message-filter
                          dest-type="QUEUE"
                          dest-name="queue/quickstart_helloworld_Request_gw"
                          />
                          </jms-bus>
                          <jms-bus busid="quickstartEsbChannel">
                          <jms-message-filter
                          dest-type="QUEUE"
                          dest-name="queue/quickstart_helloworld_Request_esb"
                          />
                          </jms-bus>

                          </jms-provider>

                          I installed JBOSS ESB 4.4 GA and I am not sure I am missing something. Any idea?
                          Thanks.
                          Salvo

                          • 10. Re: Could not send ESB message to remote host.
                            beve

                            Hi Savlo,

                            please don't hijack other threads as this can be confusing. Just create a new thread if you have future issues.

                            Thanks,

                            /Daniel