1 Reply Latest reply on Nov 16, 2005 9:40 AM by mjreged

    Swing Client ERROR :javax.naming.CommunicationException

      I have EJB3 running well, the client connects and persists classes , everything works as long as i have the client on the same machince as the JBoss Server
      As soon i move the client to different machine i get this exception :

      java -jar EJBClient.jar
      
      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]
      
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:707)
      
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      
       at javax.naming.InitialContext.lookup(Unknown Source)
      
       at ejbclient.Main.main(Main.java:49)
      
      Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nes
      
      ted exception is:
      
       java.net.ConnectException: Connection refused: connect
      
       at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
      
       at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
      
       at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
      
       at sun.rmi.server.UnicastRef.invoke(Unknown Source)
      
       at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
      
       ... 3 more
      
      Caused by: java.net.ConnectException: Connection refused: connect
      
       at java.net.PlainSocketImpl.socketConnect(Native Method)
      


      I am thinking, that i am missing a library, or some kind of xml descriptor i should be having, i don't know. Nobody is providing answers to questions and there are no good HOWTO's for doing the simplest things.

      The Trailblazer are way to conceptual, except for the Dell DVD example, but that does not address remote swing clients


        • 1. Re: Swing Client ERROR :javax.naming.CommunicationException

          OK i found something about that in another forum,
          Running Linux distros can create the problem


          This problem will mainly happen on redhar based linux distros (not suse etc thou, only those directly based on RH like centos etc)
          You need to update your hosts file. By default you will have an entry for 127.0.0.1 with your hostnames next to it like follows:

          127.0.0.1 myserver.server.com myserver localhost localhost.localdomain

          you need to add a line for your local ip address also and then move your hostnames to it, leaving the localhost entries on 127.0.0.1 like such:

          127.0.0.1 localhost localhost.localdomain
          192.168.100.1 myserver.server.com myserver

          Then restart jboss. It will now bind to both 127.0.0.1 and the 192 (or other) address allowing you to access it from remote machines.



          I don't know yet myself if that's the cause of the problem for me
          I am Running Ubuntu Linux 5.10 on 2.6.14 kernel
          JBoss 4.0.3 sp1

          i will look into this next