Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

RMI> no skeleton?

Thread view: 
Nancy.Nicole@gmail.com - 15 Aug 2006 15:11 GMT
I am trying to teach myself RMI for an internship I've got (I'm a
computer science student). I'm trying to compile sample code to see how
this works before I implement my own, but every time I try the rmic
ClassName.java I get the stub but no skeleton. Any suggestions?

Thanks!
Nancy
Matt Humphrey - 15 Aug 2006 19:29 GMT
>I am trying to teach myself RMI for an internship I've got (I'm a
> computer science student). I'm trying to compile sample code to see how
> this works before I implement my own, but every time I try the rmic
> ClassName.java I get the stub but no skeleton. Any suggestions?

Your book may be out of date.  Skeleton classes are no longer needed and
rmic no longer produces them.

Matt Humphrey matth@ivizNOSPAM.com http://www.iviz.com/
Nancy.Nicole@gmail.com - 15 Aug 2006 19:39 GMT
> >I am trying to teach myself RMI for an internship I've got (I'm a
> > computer science student). I'm trying to compile sample code to see how
[quoted text clipped - 5 lines]
>
> Matt Humphrey matth@ivizNOSPAM.com http://www.iviz.com/

Hmm...well, it's not working properly. How do you call the handle? I
have

quoteServer = "rmi://localhost//Quotes";

Thanks.
Matt Humphrey - 16 Aug 2006 00:04 GMT
>> >I am trying to teach myself RMI for an internship I've got (I'm a
>> > computer science student). I'm trying to compile sample code to see how
[quoted text clipped - 10 lines]
>
> quoteServer = "rmi://localhost//Quotes";

I don't have a short example to share, but these are the essential
components:

1) I define my server as an interface, such as (in a project shared by the
client and server)

public interface IServer extends Remote {

2) I implement the server (in a separate project) as

public class RMIServer extends UnicastRemoteObject  implements IJukebox

3) I run rmic on the server and place the generated classes with the client

4) When the server starts up it registers itself as

  RMIServer server = new RMIServer();

  LocateRegistry.createRegistry(5001);
  Naming.rebind("//:5001/MyServer", server);

5) The client gets the remote object by

IServer myServer = (IServer) Naming.lookup("//serverHost:5001/MyServer");

This is a very simple technique but it allows the export of additional
remote objects as well as callbacks from the server to the client.  I  no
longer remeber where I got the design from, but I've been using it (with
alot of success) for quite a while.

Matt Humphrey matth@ivizNOSPAM.com http://www.iviz.com/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.