3 Replies Latest reply on Sep 22, 2005 9:18 PM by Domingos Creado

    Remote connection to JMS Topic fails (yes, I've searched the

    Joe Mihalich Newbie

      Hi, I know someone is going to flame me, so I will put as much anit-flaming information in this message as I can, because I'm tired of this problem, and not being able fix it based on all the information I've read about it in this forum.

      Here is my setup: (Server)
      JBoss 3.2.6 (No I cannot upgrade to the latest version)
      (Yes, supposedly this version contains the fix mentioned in the post: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=41395&postdays=0&postorder=asc&start=0 )

      Windows Server 2003 (Yes, windows firewall is turned off)
      Multi-Homed Box (NIC1: (DHCP), NIC2: (static)
      Windows system32/drivers/etc/hosts file contains: localhost myhostname
      This box is a DHCP server for the 10.11.1.x NIC side.
      Routing and Remote Access is configured on this box for routing on the 10.11.1.x NIC side.

      Client Setup:
      Windows XP
      Connection Info:
      Connection Factory: UIL2XAConnectionFactory
      Provider Url: jnp://
      Context factory: org.jnp.interfaces.NamingContextFactory

      Yes, I turned on TRACE logging on the client side by adding

      < category name="org.jboss.mq">
      < priority value="TRACE"/>
      </ category>

      to my log4j.xml file...but this seems to do no good because I see zero
      trace logging in my log file from any classes in that package. Yes I am sure that log4j.xml file is the file being read when my client starts.

      I execute the following code on the client side:

      Hashtable props = new Hashtable();
      props.put(InitialContext.INITIAL_CONTEXT_FACTORY, contextFactory);
      props.put(InitialContext.PROVIDER_URL, providerUrl);
      InitialContext initialContext = new InitialContext(props);
      Object obj = ctx.lookup(connectionFactory);

      the ctx.lookup method calls is blocking, and then timing out after a couple of minutes with this execption (you've seen it 1000 times in this forum already)

      2005-09-15 12:40:48,740 [main] ERROR com.mwvis.im.alerts.JMSTopicConnection : Error connecting to JMS Server on topic: topic/jms.ims.T
      javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host:; nested exception is:
      java.net.ConnectException: Connection timed out: connect]
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:649)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:509)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at com.mwvis.im.alerts.JMSTopicConnection.connectToTopic(JMSTopicConnection.java:143)
      at com.mwvis.im.alerts.JMSTopicConnection.connect(JMSTopicConnection.java:86)
      at com.mwvis.im.test.JMSTopicWatch.createJMSConnections(JMSTopicWatch.java:431)
      at com.mwvis.im.test.JMSTopicWatch.run(JMSTopicWatch.java:302)
      at com.mwvis.im.test.JMSTopicWatch.main(JMSTopicWatch.java:454)
      Caused by: java.rmi.ConnectException: Connection refused to host:; nested exception is:
      java.net.ConnectException: Connection timed out: connect
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:530)

      Will somebody PLEASE tell me which step I'm missing to make this work? I can connect to the topic fine if I remotely connect to it on the 10.11.1.x network card side. But when I put my client computer on the 172.16.96.x side, it's throwing that exception. Yes, I need to be able to connect on both nic's.

      As far as I was aware, the only fix needed to make this work was to add an entry in the hosts file on windows with the appropriate entry. But it does NOT work on this box, unless I fixed the file incorrectly.