Announcement Announcement Module
Collapse
No announcement yet.
Using UnicastRemoteObject slows me down! Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using UnicastRemoteObject slows me down!

    hi ...

    i created a small RMI Server this this setup code:


    public static void main(String[] args) {
    try {
    LocateRegistry.createRegistry(2001) ;
    final Compute engine = new ComputeImpl();
    Naming.rebind("//localhost:2001/Compute",engine);
    System.out.println("ComputeEngine bound");
    } catch (Exception e) {
    e.printStackTrace();
    }
    }


    i'm sending to this server an object which extends
    UnicastRemoteObject.


    when the server and the client reside on the same machine, all goes
    well.
    however when the server is on a unix machine and the client is on a pc
    i get:
    java.rmi.ServerException: RemoteException occurred in server thread;
    nested exception is:
    java.rmi.ConnectIOException: Exception creating connection to:
    172.30.104.23; nested exception is:
    java.net.SocketException: Connection timed out:could be due to
    invalid address
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:
    340)
    at sun.rmi.transport.Transport$1.run(Transport.java:1 68)
    at java.security.AccessController.doPrivileged(Access Controller.java:
    279)
    at sun.rmi.transport.Transport.serviceCall(Transport. java:164)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages
    (TCPTransport.java:506)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.handleRequest
    (TCPTransport.java:838)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run
    (TCPTransport.java:912)
    at java.lang.Thread.run(Thread.java:810)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceiv edFromServer
    (StreamRemoteCall.java:247)
    at sun.rmi.transport.StreamRemoteCall.executeCall
    (StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:1 26)
    at java.rmi.server.RemoteObjectInvocationHandler.invo keRemoteMethod
    (RemoteObjectInvocationHandler.java:179)
    at java.rmi.server.RemoteObjectInvocationHandler.invo ke
    (RemoteObjectInvocationHandler.java:132)
    at $Proxy0.invoke(Unknown Source)
    at com.pnx.rmi.client.CallerClient.main(CallerClient. java:14)
    Caused by: java.rmi.ConnectIOException: Exception creating connection
    to: 172.30.104.23; nested exception is:
    java.net.SocketException: Connection timed out:could be due to
    invalid address
    at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEnd point.java:603)
    at sun.rmi.transport.tcp.TCPChannel.createConnection( TCPChannel.java:
    204)
    at sun.rmi.transport.tcp.TCPChannel.newConnection(TCP Channel.java:
    190)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:1 09)
    at java.rmi.server.RemoteObjectInvocationHandler.invo keRemoteMethod(


    when the 172.30.104.23 is actually the PC's address (not the
    server's) and i allready tried using the hostname parameter on the server


    the 2nd issue is that it takes a long long time for me to actually get
    the exception, (about a minute)


    all this will not happen if the object being transfered will not
    extend UniicaseRemoteObject, but rather implements Serliazble


    what's going on?
    Last edited by emaayan; Nov 18th, 2008, 12:31 AM.

  • #2
    How does the question relate to Spring?

    Comment

    Working...
    X