5 Replies Latest reply on Oct 17, 2003 5:13 PM by arabin

    How can I set jndi to work on the client

    sydney Newbie

      Hi,

      I am new in JBoss & Java too. And try to write my first session bean to test my JBoss server. I deployed the bean successfully. I can saw it on the agent view / management section and named "titan/MyHello". But I tired to run my test client. It got an error message:

      ------------------------------------------------
      javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interf
      aces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
      ------------------------------------------------

      I already configurated the classpath and placed the jndi.properties file into the path. And there is the content of jndi.properties:

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

      And this is my test client program. It throws exception at the lookup("titan/MyHello") statement.

      --------------------------------------------------

      import com.titan.myhello.MyHello;
      import com.titan.myhello.MyHelloHome;

      import javax.naming.InitialContext;
      import javax.naming.Context;
      import javax.naming.NamingException;
      import javax.ejb.CreateException;
      import java.rmi.RemoteException;
      import javax.rmi.PortableRemoteObject;
      import java.util.Properties;

      public class MyHelloClient {
      public static void main (String[] args) {
      try
      {
      System.out.println("Line 0");

      Context jndiContext = new InitialContext();

      Object ref = (MyHelloHome)jndiContext.lookup("titan/MyHello");

      MyHelloHome home = (MyHelloHome)PortableRemoteObject.narrow (ref, MyHelloHome.class);

      MyHello myhello = home.create();

      System.out.println(myhello.sayHi("Sydney"));
      }
      catch (Exception e)
      {
      System.out.println(e.toString());
      }
      }
      }
      --------------------------------------------------

      Wish the experts can help, thx.


      Best regards,
      Sydney

        • 1. Re: How can I set jndi to work on the client
          Adrian Brock Master

          You're missing jnp-client.jar from your classpath.
          You can find this in JBOSS_HOME/client

          You might want to get the documentation, it will probably
          save you a lot time and stop you pulling your hair out:-)

          http://www.jboss.org/doco.jsp

          Regards,
          Adrian

          • 2. Re: How can I set jndi to work on the client
            sydney Newbie

            Adrian,

            Thx for your help, but now, I got another error message about it:

            ------------------------------------
            javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused: connect]
            -------------------------------------

            I have place jndi.properties placed in the classpath and with following lines:

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

            P.S. I run this test client on a remote machine.

            One more question: Should I add all \jboss\client\*.jar @ classpath?

            Best Regards,
            Sydney

            • 3. Re: How can I set jndi to work on the client
              Adrian Brock Master

              First the easy one,
              You don't need everything in jboss\client for j2ee.

              There are client jars in there for all sorts.

              I suggest you read the docs so you understand
              what is going on here, it will make it easier if you
              get problems in the future.

              The harder one is network configuration.
              You are the second person to report the 127.0.0.1
              problem today, I'd never seen it before :-)

              Here's a link.

              http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/

              • 4. Re: How can I set jndi to work on the client
                Michael Beauford Newbie

                With regards to the 127.0.0.1 error, I had the same problem, it involved making some changes to the JBoss.properties file on the machine I was running JBoss on. I ended up putting the machines IP address in place of the local host name. Then I had to mess around with the ipchains table under Linux 'cause I had to high of security setting on the box. After I did that I was able to talk to the box and JBoss.

                • 5. Re: How can I set jndi to work on the client
                  arabin Novice

                  I am running Jboss 3.2.2RC3 on Linux RedHat 9, version 2.4.20-8 #1
                  I am experiancing problems with connecting from java program on one machine (192.168.1.43) to Jboss running on another one (192.168.1.40).
                  The java program creates initial context using the following code
                  {
                  Properties prop = new Properties ();
                  prop.put (Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                  prop.put (Context.PROVIDER_URL, jnp://192.168.1.40:1099");
                  prop.put (Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
                  initCtx = new InitialContext (prop);
                  }
                  Then it creates
                  QueueConnectionFactory qfact = (QueueConnectionFactory) initCtx.lookup("QueueConnectionFactory");

                  Then it creates other staff (QueueConnection, Queue, QueueSender) and sends the message.

                  Everything works OK under Windows (when both machines are windows XP machines), the messages from machine 192.168.1.43 are sent correctly to machine 192.168.1.40

                  Under Linux situation is different. I try various versions of the file /etc/hosts on machine 192.168.1.40, as well as different ways to start Jboss on 192.168.1.40 machine. Those two different ways are with the line -Djava.rmi.server.hostname=192.168.1.40 and without this option in my run.sh file.

                  Any ideas?

                  The results are the following:
                  /etc/hosts on machine 192.168.1.40
                  # Do not remove the following line, or various programs
                  # that require network functionality will fail.
                  127.0.0.1 localhost.localdomain localhost
                  option -Djava.rmi.server.hostname=192.168.1.40
                  server output (192.168.1.40)
                  no output, send from 192.168.1.43 completed correctly, but message driven bean on 192.168.1.40 did not get the results
                  client output (192.168.1.43)
                  no output, send from 192.168.1.43 completed correctly, but message driven bean on 192.168.1.40 did not get the results

                  /etc/hosts on machine 192.168.1.40
                  # Do not remove the following line, or various programs
                  # that require network functionality will fail.
                  127.0.0.1 localhost.localdomain localhost
                  192.168.1.40 192.168.1.40
                  option -Djava.rmi.server.hostname=192.168.1.40
                  server output (192.168.1.40)
                  no output, send from 192.168.1.43 completed correctly, but message driven bean on 192.168.1.40 did not get the results
                  client output (192.168.1.43)
                  no output, send from 192.168.1.43 completed correctly, but message driven bean on 192.168.1.40 did not get the results

                  /etc/hosts on machine 192.168.1.40
                  # Do not remove the following line, or various programs
                  # that require network functionality will fail.
                  127.0.0.1 localhost.localdomain localhost 192.168.1.40
                  option -Djava.rmi.server.hostname=192.168.1.40
                  server output (192.168.1.40)
                  no output, send from 192.168.1.43 completed correctly, but message driven bean on 192.168.1.40 did not get the results
                  client output (192.168.1.43)
                  no output, send from 192.168.1.43 completed correctly, but message driven bean on 192.168.1.40 did not get the results

                  /etc/hosts on machine 192.168.1.40
                  # Do not remove the following line, or various programs
                  # that require network functionality will fail.
                  192.168.1.40 localhost.localdomain localhost 127.0.0.1
                  option -Djava.rmi.server.hostname=192.168.1.40
                  server output (192.168.1.40)
                  2003-10-17 17:49:40,720 DEBUG [org.jboss.mq.il.oil.OILClientIL] ConnectionReceiverOILClient is connecting to: 127.0.0.1:54027
                  2003-10-17 17:49:40,726 ERROR [org.jboss.mq.il.oil.OILClientIL] Cannot connect to the ConnectionReceiver/Server
                  java.net.ConnectException: Connection refused
                  at java.net.PlainSocketImpl.socketConnect(Native Method)
                  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                  at java.net.Socket.connect(Socket.java:452)
                  at java.net.Socket.connect(Socket.java:402)
                  at java.net.Socket.(Socket.java:309)
                  at java.net.Socket.(Socket.java:153)
                  at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:175)
                  at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:156)
                  at org.jboss.mq.il.oil.OILClientIL.pong(OILClientIL.java:112)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:823)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.ping(JMSServerInterceptorSupport.java:308)
                  at org.jboss.mq.server.TracingInterceptor.ping(TracingInterceptor.java:712)
                  at org.jboss.mq.server.JMSServerInvoker.ping(JMSServerInvoker.java:310)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:329)
                  at java.lang.Thread.run(Thread.java:534)
                  2003-10-17 17:49:40,742 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
                  2003-10-17 17:49:40,745 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
                  2003-10-17 17:49:40,746 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
                  2003-10-17 17:49:40,746 WARN [org.jboss.mq.il.oil.OILServerILService] Client request resulted in a server exception:
                  org.jboss.mq.SpyJMSException: Could not pong; - nested throwable: (java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:827)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.ping(JMSServerInterceptorSupport.java:308)
                  at org.jboss.mq.server.TracingInterceptor.ping(TracingInterceptor.java:712)
                  at org.jboss.mq.server.JMSServerInvoker.ping(JMSServerInvoker.java:310)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:329)
                  at java.lang.Thread.run(Thread.java:534)
                  Caused by: java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server
                  at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:183)
                  at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:156)
                  at org.jboss.mq.il.oil.OILClientIL.pong(OILClientIL.java:112)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:823)
                  ... 5 more
                  client output (192.168.1.43)
                  no output, send from 192.168.1.43 completed correcttly

                  /etc/hosts on machine 192.168.1.40
                  # Do not remove the following line, or various programs
                  # that require network functionality will fail.
                  192.168.1.40 localhost.localdomain localhost
                  option -Djava.rmi.server.hostname=192.168.1.40
                  server output (192.168.1.40)
                  2003-10-17 17:53:40,769 ERROR [org.jboss.mq.il.oil.OILClientIL] Cannot connect to the ConnectionReceiver/Server
                  java.net.ConnectException: Connection refused
                  at java.net.PlainSocketImpl.socketConnect(Native Method)
                  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                  at java.net.Socket.connect(Socket.java:452)
                  at java.net.Socket.connect(Socket.java:402)
                  at java.net.Socket.(Socket.java:309)
                  at java.net.Socket.(Socket.java:153)
                  at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:175)
                  at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:156)
                  at org.jboss.mq.il.oil.OILClientIL.pong(OILClientIL.java:112)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:823)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.ping(JMSServerInterceptorSupport.java:308)
                  at org.jboss.mq.server.TracingInterceptor.ping(TracingInterceptor.java:712)
                  at org.jboss.mq.server.JMSServerInvoker.ping(JMSServerInvoker.java:310)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:329)
                  at java.lang.Thread.run(Thread.java:534)
                  2003-10-17 17:53:40,842 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
                  2003-10-17 17:53:40,846 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
                  2003-10-17 17:53:40,846 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
                  2003-10-17 17:53:40,846 WARN [org.jboss.mq.il.oil.OILServerILService] Client request resulted in a server exception:
                  org.jboss.mq.SpyJMSException: Could not pong; - nested throwable: (java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:827)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.ping(JMSServerInterceptorSupport.java:308)
                  at org.jboss.mq.server.TracingInterceptor.ping(TracingInterceptor.java:712)
                  at org.jboss.mq.server.JMSServerInvoker.ping(JMSServerInvoker.java:310)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:329)
                  at java.lang.Thread.run(Thread.java:534)
                  Caused by: java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server
                  at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:183)
                  at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:156)
                  at org.jboss.mq.il.oil.OILClientIL.pong(OILClientIL.java:112)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:823)
                  ... 5 more
                  client output (192.168.1.43)
                  no output, send from 192.168.1.43 completed correcttly

                  /etc/hosts on machine 192.168.1.40
                  # Do not remove the following line, or various programs
                  # that require network functionality will fail.
                  127.0.0.1 localhost.localdomain localhost
                  no option -Djava.rmi.server.hostname=192.168.1.40, just plain start
                  server output (192.168.1.40)
                  no output, send from 192.168.1.43 completed correcttly, but message driven bean on 192.168.1.40 did not get the results
                  client output (192.168.1.43)
                  IP 192.168.1.40 Host 192.168.1.40 initCtx javax.naming.InitialContext@cb6009
                  javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
                  java.net.ConnectException: Connection refused]
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:647)
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
                  at javax.naming.InitialContext.lookup(InitialContext.java:347)
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectSenderImpl.obtainQueueConnectionFactory(MessageServiceObjectSenderImpl.java:357)
                  >That is call initCtx.lookup("QueueConnectionFactory");
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectSender.finallySendToHubAndWait(MessageServiceObjectSender.java:378)
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectHighSender.sendAndWaitResponse(MessageServiceObjectHighSender.java:382)
                  at com.wrn.teamworks.cms.cms.MessageServiceObject.sendAndReceive(MessageServiceObject.java:659)
                  at com.wrn.teamworks.cms.client.ExampleRemoteSenderAndAsynchWaiter.main(ExampleRemoteSenderAndAsynchWaiter.java:59)
                  Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
                  java.net.ConnectException: Connection refused
                  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:528)
                  ... 7 more
                  Caused by: java.net.ConnectException: Connection refused
                  at java.net.PlainSocketImpl.socketConnect(Native Method)
                  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                  at java.net.Socket.connect(Socket.java:452)
                  at java.net.Socket.connect(Socket.java:402)
                  at java.net.Socket.(Socket.java:309)
                  at java.net.Socket.(Socket.java:124)
                  at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
                  at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
                  at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
                  ... 12 more


                  /etc/hosts on machine 192.168.1.40
                  # Do not remove the following line, or various programs
                  # that require network functionality will fail.
                  127.0.0.1 localhost.localdomain localhost
                  192.168.1.40 192.168.1.40
                  no option -Djava.rmi.server.hostname=192.168.1.40, just plain start
                  server output (192.168.1.40)
                  no output, send from 192.168.1.43 completed correcttly, but message driven bean on 192.168.1.40 did not get the results
                  client output (192.168.1.43)
                  same thing
                  IP 192.168.1.40 Host 192.168.1.40 initCtx javax.naming.InitialContext@cb6009
                  javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
                  java.net.ConnectException: Connection refused]
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:647)
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
                  at javax.naming.InitialContext.lookup(InitialContext.java:347)
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectSenderImpl.obtainQueueConnectionFactory(MessageServiceObjectSenderImpl.java:357)
                  >That is call initCtx.lookup("QueueConnectionFactory");
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectSender.finallySendToHubAndWait(MessageServiceObjectSender.java:378)
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectHighSender.sendAndWaitResponse(MessageServiceObjectHighSender.java:382)
                  at com.wrn.teamworks.cms.cms.MessageServiceObject.sendAndReceive(MessageServiceObject.java:659)
                  at com.wrn.teamworks.cms.client.ExampleRemoteSenderAndAsynchWaiter.main(ExampleRemoteSenderAndAsynchWaiter.java:59)
                  Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
                  java.net.ConnectException: Connection refused
                  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:528)
                  ... 7 more
                  Caused by: java.net.ConnectException: Connection refused
                  at java.net.PlainSocketImpl.socketConnect(Native Method)
                  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                  at java.net.Socket.connect(Socket.java:452)
                  at java.net.Socket.connect(Socket.java:402)
                  at java.net.Socket.(Socket.java:309)
                  at java.net.Socket.(Socket.java:124)
                  at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
                  at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
                  at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
                  ... 12 more


                  /etc/hosts on machine 192.168.1.40
                  # Do not remove the following line, or various programs
                  # that require network functionality will fail.
                  127.0.0.1 localhost.localdomain localhost 192.168.1.40
                  no option -Djava.rmi.server.hostname=192.168.1.40, just plain start
                  server output (192.168.1.40)
                  no output, send from 192.168.1.43 completed correcttly, but message driven bean on 192.168.1.40 did not get the results
                  client output (192.168.1.43)
                  same thing
                  IP 192.168.1.40 Host 192.168.1.40 initCtx javax.naming.InitialContext@cb6009
                  javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
                  java.net.ConnectException: Connection refused]
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:647)
                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
                  at javax.naming.InitialContext.lookup(InitialContext.java:347)
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectSenderImpl.obtainQueueConnectionFactory(MessageServiceObjectSenderImpl.java:357)
                  >That is call initCtx.lookup("QueueConnectionFactory");
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectSender.finallySendToHubAndWait(MessageServiceObjectSender.java:378)
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectHighSender.sendAndWaitResponse(MessageServiceObjectHighSender.java:382)
                  at com.wrn.teamworks.cms.cms.MessageServiceObject.sendAndReceive(MessageServiceObject.java:659)
                  at com.wrn.teamworks.cms.client.ExampleRemoteSenderAndAsynchWaiter.main(ExampleRemoteSenderAndAsynchWaiter.java:59)
                  Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
                  java.net.ConnectException: Connection refused
                  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:528)
                  ... 7 more
                  Caused by: java.net.ConnectException: Connection refused
                  at java.net.PlainSocketImpl.socketConnect(Native Method)
                  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                  at java.net.Socket.connect(Socket.java:452)
                  at java.net.Socket.connect(Socket.java:402)
                  at java.net.Socket.(Socket.java:309)
                  at java.net.Socket.(Socket.java:124)
                  at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
                  at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
                  at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
                  ... 12 more


                  /etc/hosts on machine 192.168.1.40
                  # Do not remove the following line, or various programs
                  # that require network functionality will fail.
                  192.168.1.40 localhost.localdomain localhost 127.0.0.1
                  no option -Djava.rmi.server.hostname=192.168.1.40, just plain start
                  server output (192.168.1.40)
                  2003-10-17 18:09:42,049 ERROR [org.jboss.mq.il.oil.OILClientIL] Cannot connect to the ConnectionReceiver/Server
                  java.net.ConnectException: Connection refused
                  at java.net.PlainSocketImpl.socketConnect(Native Method)
                  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                  at java.net.Socket.connect(Socket.java:452)
                  at java.net.Socket.connect(Socket.java:402)
                  at java.net.Socket.(Socket.java:309)
                  at java.net.Socket.(Socket.java:153)
                  at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:175)
                  at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:156)
                  at org.jboss.mq.il.oil.OILClientIL.pong(OILClientIL.java:112)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:823)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.ping(JMSServerInterceptorSupport.java:308)
                  at org.jboss.mq.server.TracingInterceptor.ping(TracingInterceptor.java:712)
                  at org.jboss.mq.server.JMSServerInvoker.ping(JMSServerInvoker.java:310)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:329)
                  at java.lang.Thread.run(Thread.java:534)
                  2003-10-17 18:09:42,076 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
                  2003-10-17 18:09:42,079 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
                  2003-10-17 18:09:42,080 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
                  2003-10-17 18:09:42,080 WARN [org.jboss.mq.il.oil.OILServerILService] Client request resulted in a server exception:
                  org.jboss.mq.SpyJMSException: Could not pong; - nested throwable: (java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:827)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.ping(JMSServerInterceptorSupport.java:308)
                  at org.jboss.mq.server.TracingInterceptor.ping(TracingInterceptor.java:712)
                  at org.jboss.mq.server.JMSServerInvoker.ping(JMSServerInvoker.java:310)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:329)
                  at java.lang.Thread.run(Thread.java:534)
                  Caused by: java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server
                  at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:183)
                  at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:156)
                  at org.jboss.mq.il.oil.OILClientIL.pong(OILClientIL.java:112)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:823)
                  ... 5 more
                  2003-10-17 18:09:42,265 DEBUG [org.jboss.mq.il.oil.OILClientIL] ConnectionReceiverOILClient is connecting to: 127.0.0.1:54494
                  2003-10-17 18:09:42,266 ERROR [org.jboss.mq.il.oil.OILClientIL] Cannot connect to the ConnectionReceiver/Server
                  java.net.ConnectException: Connection refused
                  at java.net.PlainSocketImpl.socketConnect(Native Method)
                  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                  at java.net.Socket.connect(Socket.java:452)
                  at java.net.Socket.connect(Socket.java:402)
                  at java.net.Socket.(Socket.java:309)
                  at java.net.Socket.(Socket.java:153)
                  at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:175)
                  at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:156)
                  at org.jboss.mq.il.oil.OILClientIL.close(OILClientIL.java:72)
                  at org.jboss.mq.server.JMSDestinationManager.connectionClosing(JMSDestinationManager.java:569)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.connectionClosing(JMSServerInterceptorSupport.java:112)
                  at org.jboss.mq.security.ServerSecurityInterceptor.connectionClosing(ServerSecurityInterceptor.java:61)
                  at org.jboss.mq.server.TracingInterceptor.connectionClosing(TracingInterceptor.java:158)
                  at org.jboss.mq.server.JMSServerInvoker.connectionClosing(JMSServerInvoker.java:114)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:268)
                  at java.lang.Thread.run(Thread.java:534)
                  client output (192.168.1.43)
                  javax.jms.IllegalStateException: The session is closed
                  at org.jboss.mq.SpyQueueSession.createSender(SpyQueueSession.java:128)
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectSenderImpl.getQueueHubSender(MessageServiceObjectSenderImpl.java:864)
                  > in the line QueueSender queueSender = session.createSender(queue);
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectSender.finallySendToHubAndWait(MessageServiceObjectSender.java:383)
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectHighSender.sendAndWaitResponse(MessageServiceObjectHighSender.java:382)
                  at com.wrn.teamworks.cms.cms.MessageServiceObject.sendAndReceive(MessageServiceObject.java:659)
                  at com.wrn.teamworks.cms.client.ExampleRemoteSenderAndAsynchWaiter.main(ExampleRemoteSenderAndAsynchWaiter.java:59)


                  /etc/hosts on machine 192.168.1.40
                  # Do not remove the following line, or various programs
                  # that require network functionality will fail.
                  192.168.1.40 localhost.localdomain localhost
                  no option -Djava.rmi.server.hostname=192.168.1.40, just plain start
                  server output (192.168.1.40)
                  2003-10-17 18:15:19,061 DEBUG [org.jboss.mq.il.oil.OILClientIL] ConnectionReceiverOILClient is connecting to: 127.0.0.1:54578
                  2003-10-17 18:15:19,067 ERROR [org.jboss.mq.il.oil.OILClientIL] Cannot connect to the ConnectionReceiver/Server
                  java.net.ConnectException: Connection refused
                  at java.net.PlainSocketImpl.socketConnect(Native Method)
                  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                  at java.net.Socket.connect(Socket.java:452)
                  at java.net.Socket.connect(Socket.java:402)
                  at java.net.Socket.(Socket.java:309)
                  at java.net.Socket.(Socket.java:153)
                  at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:175)
                  at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:156)
                  at org.jboss.mq.il.oil.OILClientIL.pong(OILClientIL.java:112)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:823)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.ping(JMSServerInterceptorSupport.java:308)
                  at org.jboss.mq.server.TracingInterceptor.ping(TracingInterceptor.java:712)
                  at org.jboss.mq.server.JMSServerInvoker.ping(JMSServerInvoker.java:310)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:329)
                  at java.lang.Thread.run(Thread.java:534)
                  2003-10-17 18:15:19,093 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
                  2003-10-17 18:15:19,096 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
                  2003-10-17 18:15:19,097 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
                  2003-10-17 18:15:19,097 WARN [org.jboss.mq.il.oil.OILServerILService] Client request resulted in a server exception:
                  org.jboss.mq.SpyJMSException: Could not pong; - nested throwable: (java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:827)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.ping(JMSServerInterceptorSupport.java:308)
                  at org.jboss.mq.server.TracingInterceptor.ping(TracingInterceptor.java:712)
                  at org.jboss.mq.server.JMSServerInvoker.ping(JMSServerInvoker.java:310)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:329)
                  at java.lang.Thread.run(Thread.java:534)
                  Caused by: java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server
                  at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:183)
                  at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:156)
                  at org.jboss.mq.il.oil.OILClientIL.pong(OILClientIL.java:112)
                  at org.jboss.mq.server.JMSDestinationManager.ping(JMSDestinationManager.java:823)
                  ... 5 more
                  2003-10-17 18:15:19,279 DEBUG [org.jboss.mq.il.oil.OILClientIL] ConnectionReceiverOILClient is connecting to: 127.0.0.1:54578
                  2003-10-17 18:15:19,279 ERROR [org.jboss.mq.il.oil.OILClientIL] Cannot connect to the ConnectionReceiver/Server
                  java.net.ConnectException: Connection refused
                  at java.net.PlainSocketImpl.socketConnect(Native Method)
                  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
                  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
                  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
                  at java.net.Socket.connect(Socket.java:452)
                  at java.net.Socket.connect(Socket.java:402)
                  at java.net.Socket.(Socket.java:309)
                  at java.net.Socket.(Socket.java:153)
                  at org.jboss.mq.il.oil.OILClientIL.createConnection(OILClientIL.java:175)
                  at org.jboss.mq.il.oil.OILClientIL.checkSocket(OILClientIL.java:156)
                  at org.jboss.mq.il.oil.OILClientIL.close(OILClientIL.java:72)
                  at org.jboss.mq.server.JMSDestinationManager.connectionClosing(JMSDestinationManager.java:569)
                  at org.jboss.mq.server.JMSServerInterceptorSupport.connectionClosing(JMSServerInterceptorSupport.java:112)
                  at org.jboss.mq.security.ServerSecurityInterceptor.connectionClosing(ServerSecurityInterceptor.java:61)
                  at org.jboss.mq.server.TracingInterceptor.connectionClosing(TracingInterceptor.java:158)
                  at org.jboss.mq.server.JMSServerInvoker.connectionClosing(JMSServerInvoker.java:114)
                  at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:268)
                  at java.lang.Thread.run(Thread.java:534)
                  client output (192.168.1.43)
                  javax.jms.IllegalStateException: The session is closed
                  at org.jboss.mq.SpyQueueSession.createSender(SpyQueueSession.java:128)
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectSenderImpl.getQueueHubSender(MessageServiceObjectSenderImpl.java:864)
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectSender.finallySendToHubAndWait(MessageServiceObjectSender.java:383)
                  at com.wrn.teamworks.cms.cms.MessageServiceObjectHighSender.sendAndWaitResponse(MessageServiceObjectHighSender.java:382)
                  at com.wrn.teamworks.cms.cms.MessageServiceObject.sendAndReceive(MessageServiceObject.java:659)
                  at com.wrn.teamworks.cms.client.ExampleRemoteSenderAndAsynchWaiter.main(ExampleRemoteSenderAndAsynchWaiter.java:59)