aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes where to bind the remote object?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "where to bind the remote object??" Watch "where to bind the remote object??" New topic
Author

where to bind the remote object??

jyothi sunke
Ranch Hand

Joined: Sep 11, 2002
Posts: 65
Hi all,
I got in to some problems related to path when binding the remote object. while working in the network mode, say my path to bind remote object is rmi://localhost:1099/"remote object name".
what will be the path for server code and from where should I start the server??
Do I need to use any server like WebLogic??
Thanks in advance..
[ October 17, 2002: Message edited by: jyothi sunke ]

jyothi
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Howdy,
If I understand your question, your "server" for your remote object is just your own java application that uses your remote object. So as long as you're on the same machine (localhost) that you specify in your client lookup, then you're OK. The 1099 port number is the default for the rmiregistry, which of course also has to be started before you can even start your server application.
The biggest issue is, "How does the client and the rmiregistry get the stub class?
Although there are cooler ways to do it, the simplest way and the clearest for the exam, is to just PUT the stub classes on the client's classpath, and also on the rmiregistry classpath. So you could start the rmiregistry and the server from the same directory, and if that's a directory from which your stub classes can be found then you're in good shape.
Then again, I might be completely wrong about what you were asking
cheers,
Kathy


Co-Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0596007124/ref=jranch-20" target="_blank" rel="nofollow">"Head First Design Patterns"</a><br /> <br />Just a Jini girl living in a J2EE world.
jyothi sunke
Ranch Hand

Joined: Sep 11, 2002
Posts: 65
Hi Kathy,
Thanks for your response. May be I am not clear in asking a question. I want to test my application in network mode. In that process ..
if my client classes path is
c:\suncertify\client\"client class name"
To access the remote object i.e, rmi://localhost:1099/"remote object name"
Where do I have to place the server classes on my PC??? If I give this server path in client class path, I am thinking that it becomes a local mode operation. Can you clarify this please...
Tahnk you..
Thomas Fly
Ranch Hand

Joined: Sep 09, 2002
Posts: 164
jyothi, see Sun Certified Java Developer and Security manager needed?
To implement downloadable stubs, you need some kind of web server running (e.g., Apache Tomcat, or the J2EE Reference Implementation server). However, as long as your client already has all the needed classes (e.g., ConnectionFactory_Stub), then you don't need a web server simply to test the application on a network (rather than connecting to a localhost server).
My server is in fact just a special case of my client, which fulfills the requirement to connect to the database "locally," while exposing the database to remote clients (perhaps on the same machine, connecting via localhost) using RMI.
Running a web server doesn't mean that you've gone to all the trouble of registering a domain name, of course. On my LAN, I can access my SCJD page via http://ThinkPad/SCJD or http://192.168.1.2/SCJD for example.
[ October 18, 2002: Message edited by: Thomas Fly ]

Fly by Night Consultants<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr><i>I climbed on the back of a giant albatross<br />which flew through a crack in the cloud<br />to a place where happiness reigned...<br />all year 'round<br />the music played ever so loudly!</i><p><a href="http://thomasfly.com/songs/Traffic/Hole_in_my_Shoe_qt.htm" target="_blank" rel="nofollow">Hole in My Shoe</a><hr></blockquote>
 
 
subject: where to bind the remote object??