aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Where does the LockManager class lie ?  db.jar or Server.jar ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Where does the LockManager class lie ?  db.jar or Server.jar ?" Watch "Where does the LockManager class lie ?  db.jar or Server.jar ?" New topic
Author

Where does the LockManager class lie ? db.jar or Server.jar ?

Zhou Can
Ranch Hand

Joined: Sep 12, 2002
Posts: 34
I think the LockManager class should stay in db.jar ,but some one advise me to place it in the server.jar . Whitch is right ?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Zhou, how many jars do you have? You should only have 2 one for the client and one for the server. So in many cases the db and the server are the same jar. if you called you server.jar, db.jar.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Zhou Can
Ranch Hand

Joined: Sep 12, 2002
Posts: 34
I think the db.jar should be in two jar files , one is the server.jar and the other is the client.jar . Am i right ?
Charles Dupin
Ranch Hand

Joined: Oct 18, 2002
Posts: 94
I have the same problem about db classes available to the client in standalone mode.
In RMI server mode the client does not need the db classes, but in standalone mode the client accesses the server db classes. Is this right or not. For that I put the server.jar in the classpath of the client. Thanks for your advices.
Charles


Charles.<br />(SCJD2)
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

You will put some of the db package classes in your client.jar.
You will need them for Local mode. You will also hav ethe _stubs from the server also in your client.jar
Zhou - Yes there are only two jars client.jar and server.jar, there is no db.jar unless you want to call your server.jar db.jar, which I think is a misnomer.
Mark
[ December 10, 2002: Message edited by: Mark Spritzler ]
Charles Dupin
Ranch Hand

Joined: Oct 18, 2002
Posts: 94
Mark,
As you say we need the stub implementation in the client jar, otherwwise it does not work, the RMI connection sends a Remote Exception. But how comes the stub must be in the client jar. Why isn't there a complete separation possible between client and server in remote mode? (interface in the client and implementation of the stub in the server). Sorry if this question looks stupid but I need an explanation here.
Thanks,
Charles.
Zhou Can
Ranch Hand

Joined: Sep 12, 2002
Posts: 34
Finally I put it in server.jar.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Charles, the reason is simple. In this assignment we are not using Dynamic Downloading of stub classes. In order to do that you would need a web server. Which of course most people don't keep in their back pockets.
So then the class would need to be accessible to the client, and the client.jar is the best place for this.
Mark
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
BTW, I personally submitted three jars: a client, a server, and a shared jar with all the shared classes needed by both client and server. The Class-Path manifest attribute will glue the jars together.
- Peter
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Where does the LockManager class lie ? db.jar or Server.jar ?