maxol
asked on
RMI Stub question...
i'm trying to transfer a stub object to allow it to be invoked on a different machine.
when i do so, the stub object no longer contains a remoteRef? it is now null?
i.e. before the transfer it returns remote ref IP = xxx.xxx.xxx.xxx + port
after transfer remote ref = null?
any help....
when i do so, the stub object no longer contains a remoteRef? it is now null?
i.e. before the transfer it returns remote ref IP = xxx.xxx.xxx.xxx + port
after transfer remote ref = null?
any help....
it seems somewhere you are wrong
can u post some code snippet so that experts understand
Best Regards
Sudhakar Chavali
Best Regards
Sudhakar Chavali
ASKER
RMI object exported is called 'myServer'
RemoteStub rs = RemoteObject.toStub(myServ er);
System.out.println(rs.toSt ring()) gives "RemoteStub [ref: 111.111.111.111 ObjID:0] ... okay
after i send it over an ObjectOutputStream and recast it as a stub the
System.out.println(rs.toSt ring()) gives "RemoteStub [ref: null] ... bad, no reference now
??
RemoteStub rs = RemoteObject.toStub(myServ
System.out.println(rs.toSt
after i send it over an ObjectOutputStream and recast it as a stub the
System.out.println(rs.toSt
??
Which version JDK?
ASKER
jdk1.4.2_01
Can you make sure it is serializable and the data you want to transfer can also be serialized?
You need to make sure the remote interface the stub is implementing is also on the other machine's classpath.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
you beauty!
i was casting it as a stub when it should have been a remote object on the client side!
i thank you!
i was casting it as a stub when it should have been a remote object on the client side!
i thank you!
You're welcome. :-)