3 Replies Latest reply on Jun 17, 2004 1:32 PM by gorano

    java.net.SocketException: Network is unreachable: connect

    heini

      Hi everybody!

      I am very new to EJBs. I have developed a client which connects to an EJB-application deployed on JBoss 3.0.4. The source code of my client is listed below.

      The server I want to connect to resides on a Solaris-system. When I run the client on the server directly, it works perfectly. I even ran it on a different Solaris-system and everything was fine. But when I run the client on my W2K-system, I get the error message with the stack trace listed below. The error happens in the last line of the source code, when I try to create a ServiceManager-object.

      The errormessage mentions an unreachable network, which cannot be the case. There is no firewall between my computer and the Solaris-systems. I can do a ping to the server or open a telnet session. I even typed the adress and port-number in my web-browser and got something looking like RMI. So I think the server should be reachable.

      I do not know, what else to try. Does anybody have an idea what the problem might be?

      Thanks.
      Michael


      Source-code of client:
      ======================

      // Setting path of the keystore
      System.setProperty( "javax.net.ssl.trustStore", "./service.keystore");

      // Initialising the Naming-Service
      java.util.Properties properties = new java.util.Properties();
      properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      properties.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      properties.put(Context.PROVIDER_URL, "jnp://server:1099"); // server_name:port
      Context context = new InitialContext(properties);

      // Getting serviceManger
      Object homeObject = context.lookup(ServiceManagerHome.class.getName());
      ServiceManagerHome serviceManagerHome =
      (ServiceManagerHome) PortableRemoteObject.narrow(homeObject,
      ServiceManagerHome.class);
      ServiceManager serviceManager = serviceManagerHome.create();



      Errormessage:
      =============
      Exception creating connection to: xxx.xxx.xxx.xxx; nested exception is:
      java.net.SocketException: Network is unreachable: connect


      java.rmi.ConnectIOException: Exception creating connection to: xxx.xxx.xxx.xxx; nested exception is:
      java.net.SocketException: Network is unreachable: connect
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:580)
      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.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:138)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy0.create(Unknown Source)
      at EssClient.run(EssClient.java:79)
      at EssClient.main(EssClient.java:126)
      Caused by: java.net.SocketException: Network is unreachable: connect
      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 com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(DashoA6275)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.(DashoA6275)
      at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(DashoA6275)
      at org.jboss.security.ssl.RMISSLClientSocketFactory.createSocket(RMISSLClientSocketFactory.java:47)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
      ... 13 more