Creating manual Stub for the Remote Objects.
Abdullah Odeh Al-Zaghameem <[email protected]> Mon, 25 Aug 2008 14:19:20 -0600
| Newsgroups | gmane.comp.java.sun.rmi |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Hi all.
This is my first contribution in this nice list, and i am sorry for it to be a
question regarding a Stub problem.
The problem is as follow:
In the server side, i write the remote interface, and the remote object class
that should implement it and without extending the UnicastRemoteObject,
then - after preparing the args - i bind an instance from that remote object as
follows:
RemoteStub remS = UnicastRemoteObject.exportObject(t);
Naming.rebind("rmi://localhost:1099/Team2", remS);
I implement the remote object stub manually, to avoid the use of rmic compiler
command in a seperate step!! and Everything is run smoothly and gracefully!!.
After deploying the stub (???_Stub.class), i try to call one of its methods from
the client side as follows:
System.setProperty("java.rmi.server.codebase","ftp://.........etc");
if(System.getSecurityManager() == null)
System.setSecurityManager(new RMISecurityManager());
try {
ITeam it = (ITeam) Naming.lookup("rmi://localhost:1099/Team2");
System.out.println(it.isAvailable()); <<<<<<<<<<<<<<<
...
BUT the system prints out a wide and long-tail exception stack at the marked
line <<<<<<<<<<<<<<< above, and here a short part from that exception:
java.rmi.ServerException: RemoteException occurred in server thread; nested
exception is:
java.rmi.UnmarshalException: unrecognized method hash: method not
supported by remote object
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
.
.
I search the archives of the mail-list but found no suitable answer, so any
notes and ideas will be very highly appreciated.
Thanks in advance.
===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS". For general help, send email to
[email protected] and include in the body of the message "help".
For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html
To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html