• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with "rmi.server.codebase"

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
-BJ
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic