5 Replies Latest reply on Sep 23, 2001 3:04 PM by pra

    javax.naming.CommunicationException.  Root exception is java

    boxhead

      Howdy all;

      I realize this has been asked somewhere before. I setup a topic, and a publisher/subscriber app. The remote subscriber cannot attach to jboss because of the below error. I tried every trick in the book: name, raw IP, etc, but I still am getting the following error. I tried jndi.props and the command line props, but no luck. When I run the code on the same machine, it fails.. the client hangs with an EOFException, and JBoss hangs trying to send the message to the client. I burned 24 hours on this problem, and I am no closer to a solution. Any tips?

      javax.naming.CommunicationException. Root exception is java.rmi.ConnectException: Connection refused to host: ; nested exception is:
      java.net.ConnectException: Connection refused: no further information
      java.net.ConnectException: Connection refused: no further information
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:312)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:125)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:112)
      at java.net.Socket.(Socket.java:273)
      at java.net.Socket.(Socket.java:100)
      at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:25)
      at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:120)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:83)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at com.boxhead.framework.controller.log.jms.ControllerLogSubscriber.(ControllerLogSubscriber.java:31)
      at com.boxhead.framework.controller.log.jms.ControllerLogSubscriber.main(ControllerLogSubscriber.java:65)

        • 1. Re: javax.naming.CommunicationException.  Root exception is

          Hi, it's looking as you are using the RMI connection factory. So I think I have been down the same path as you (ending up in having to read the sun RMI code).

          One common problem with RMI is what name of the server it gets. This will be sent from the server to the client RMI classes, and there be used to connect to the server. If it gets a non valid hostname, the client will not be able to connect to the server.

          You should define the java.rmi.server.hostname to the real hostname of your server, eh -Djava.rmi.server.hostname=my.real.hostname

          For up to 2.4 put it in conf/default/jboss.properties.

          With JBossMQ I have also sometime been forced to define the jndi in conf/default/jndi.properties to the real hostname to, eg:

          java.naming.provider.url=my.real.hostname:1099

          Be aware though that a sideeffect of this is that local optimized calles for EJB won't work.

          Another way around it is to use the UIL connection factory. Since this is a oneway connection, there is no callback to the server.

          But then again. Maybe you are experienting some other cind of problem.

          //Peter

          • 2. Re: javax.naming.CommunicationException.  Root exception is
            boxhead

            What about the EOFException issue? Is that just because 2.4.0 is unstable? Thanks for your help ...

            • 3. Re: javax.naming.CommunicationException.  Root exception is
              boxhead

              Also, with the client, it leads me to believe that a /conf/default/jboss.conf (.props) needs to exist on the client machine. Is this correct ?!

              • 4. Re: javax.naming.CommunicationException.  Root exception is

                > What about the EOFException issue? Is that just
                > because 2.4.0 is unstable? Thanks for your help ...
                The JBossMQ in 2.4.1 is much better than the one in 2.4.0. The EOF stuff seems to have plauged the 2.4.0 (but unfortunately I have also seen it in later version).

                //Peter

                • 5. Re: javax.naming.CommunicationException.  Root exception is

                  > Also, with the client, it leads me to believe that a
                  > /conf/default/jboss.conf (.props) needs to exist on
                  > the client machine. Is this correct ?!

                  No it's not. Thats server only!

                  //Peter