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
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
posted
0
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
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
posted
0
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.
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
posted
0
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