Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where to bind the remote object??

 
jyothi sunke
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
jyothi sunke
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic