jQuery in Action, 3rd edition
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes problem with 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 "problem with "rmi.server.codebase"" Watch "problem with "rmi.server.codebase"" New topic

problem with "rmi.server.codebase"

Tim Adam Cooper

Joined: Jul 29, 2002
Posts: 17
For the Developer's exam, I have been doing experiments with the rmi property: rmi.server.codebase.
It does not seem to be working. I did the following steps:
1.All the necessary classes including the stubs, skeletons and interface are in a directory called C:\RMI\classes.
2.At the MS-DOS command prompt I start the rmiregistry.
3.Then in another MS-DOS window I went to the root directory (C:\> and type in the line as below:
C:\>java -Djava.rmi.server.codebase=file:/C:\RMI\classes WeatherServer
Where WeatherServer is the name of the program that implements the interface.

It does not work. I kept getting the message ´┐ŻNoClassDefFoundError´┐Ż
Can anybody shed some light on it?
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
Even though you are specifying a codebase, you still need to make sure the classpath is set. The codebase property is a value that is sent to the client by the rmi runtime to let the client know where to download the files from, but in the context of running your WeatherServer class you still need to specify to the JVM where to find the classes, just as you would when executing any java program.
Try something like:
C:\>java -cp %CLASSPATH%;c:\pathtoyourclasses -Djava.rmi.server.codebase=file:///C:\RMI\classes WeatherServer
I agree. Here's the link: http://aspose.com/file-tools
subject: problem with "rmi.server.codebase"
It's not a secret anymore!