Link to home
Start Free TrialLog in
Avatar of maxol
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....
Avatar of sudhakar_koundinya
sudhakar_koundinya

it seems somewhere you are wrong
can u post some code snippet so that experts understand

Best Regards
Sudhakar Chavali
Avatar of maxol

ASKER

RMI object exported is called 'myServer'

RemoteStub rs = RemoteObject.toStub(myServer);

System.out.println(rs.toString())    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.toString())    gives "RemoteStub [ref: null] ... bad, no reference now

??
Which version JDK?
Avatar of maxol

ASKER

jdk1.4.2_01
Avatar of girionis
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
Avatar of wolfc
wolfc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maxol

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!
You're welcome. :-)