0 Replies Latest reply on Aug 17, 2011 5:52 AM by Wen Cheng

    When using EJB: rmi.UnknownHostException

    Wen Cheng Newbie



      I deploy my project in jboss6, the computer IP is The project contains both web and ejb3 functions.


      The starting paramters and the result is as follows:




            Usage Way

      run.bat -b
      run.bat -b

      【any computer】


      【in localhost】


      【in】 ejb with url:

      (another computer in 10.26.12.*)


      【in】 ejb with url:

      another computer in a different subnet,

      for example, 10.26.12.*


      【in localhostejb with url:



      Firstly, I found that I can only acess jboss in the computer which the Jboss is installed.

      Then I change to "run.bat -b"。 The parameter "-b" made the access in another computer possible.But soon we found that the ejb access was refused if the client computer is not in the same subnet. In another word, If I access the server In by ejb, it works, but if I access the server in, it fails. By the way ,I can access in

      The error log is :

      [javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: WINP1299; nested exception is: 
          java.net.UnknownHostException: WINP1299]]
          at com.css.waterbox.server.api.consoleapi.SessionDriver.createSessionEJB(Unknown Source)
          at com.css.waterbox.server.api.consoleapi.SessionDriver.createRemoteSession(Unknown Source)
          at com.css.waterbox.server.api.consoleapi.SessionDriver.createSession(Unknown Source)
          at com.css.waterbox.server.api.consoleapi.SessionDriver.getSession(Unknown Source)
          at com.css.waterbox.server.api.consoleapi.SessionFactory.constructSession(Unknown Source)
          at com.css.waterbox.console.frame.dialog.LoadDialog.loadServer(Unknown Source)
          at com.css.waterbox.console.frame.dialog.LoadDialog$LoadThread.run(Unknown Source)
      Caused by: javax.naming.CommunicationException [Root exception is java.rmi.UnknownHostException: Unknown host: WINP1299; nested exception is: 
          java.net.UnknownHostException: WINP1299]
          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)
          ... 7 more
      Caused by: java.rmi.UnknownHostException: Unknown host: WINP1299; nested exception is: 
          java.net.UnknownHostException: WINP1299
          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)
          ... 9 more
      Caused by: java.net.UnknownHostException: WINP1299
          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)
          ... 14 more


      In order to solve the "cross-subnet problem", I changed the parameter to "-b". Then I can use ejb in But the "localhost" or the "" way to access become unsuccessful.


      Now , how can I make every way to access jboss successful?