1 Reply Latest reply on Jun 30, 2010 6:51 AM by Wolfgang Knauf

    Problem with remote JNP. Can't connect to remote JBoss

    Ilya Muromtsev Newbie

      When startup JBoss localy it is works fine: all beans are works well.

       

      I want to separate server and remote client.

       

      But when I trying to connect to remote JBoss by changing java.naming.provider.url property

                from jnp://127.0.0.1:1099

                to jnp://remote-JBoss-IP:1099

      in the jndi.properties file.

       

      Resulted jndi.properties file is:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

      java.naming.provider.url=jnp://remote-JBoss-IP:1099

       

      Then I recieve an exception:

       

      javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: server; nested exception is:
              java.net.UnknownHostException: server]
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:841)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)
              at javax.naming.InitialContext.lookup(InitialContext.java:392)
              at ru.net.wingbull.shop.client.ApplicationMain.createAndShowGUI(ApplicationMain.java:28)
              at ru.net.wingbull.shop.client.ApplicationMain.access$000(ApplicationMain.java:16)
              at ru.net.wingbull.shop.client.ApplicationMain$1.run(ApplicationMain.java:45)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
      Caused by: java.rmi.UnknownHostException: Unknown host: server; nested exception is:
              java.net.UnknownHostException: server
              at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:598)
              at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
              at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
              at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
              at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
              ... 13 more
      Caused by: java.net.UnknownHostException: server
              at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
              at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
              at java.net.Socket.connect(Socket.java:529)
              at java.net.Socket.connect(Socket.java:478)
              at java.net.Socket.<init>(Socket.java:375)
              at java.net.Socket.<init>(Socket.java:189)
              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:595)
              ... 18 more
      Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: javax.naming.CommunicationException [Root exception is java.rmi.UnknownHo
      stException: Unknown host: server; nested exception is:
              java.net.UnknownHostException: server]
              at ru.net.wingbull.shop.client.ApplicationMain$1.run(ApplicationMain.java:48)
              at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
      Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: server; nested exception is:

       

       

      BTW, remote machine localy named as "server", and I checked (using tcpview tool) that client application establish connection with remote-JBoss on 1099 but then throwing this exception. How to avoid it?

       

      Ilya