running an RMI server in command line and eclipse
- by Noona
I need to run my RMI server using the command line,
my class files reside in this folder:
C:\workspace\distributedhw2\AgencyServers\RmiEncodingServer\RmiServerClasses
in package hw2.rmi.server
The code base reside in this folder:
C:\workspace\distributedhw2\AgencyServers\RmiEncodingServer\RmiServerCodeBase
in package hw2.rmi.server
I use the command line:
java –classpath C:\workspace\distributedhw2\AgencyServers\RmiEncodingServer\RmiServerClasses\ -Djava.rmi.server.codebase=file:/C:\workspace\distributedhw2\AgencyServers\RmiEncodingServer\ Djava.security.policy=c:\HW2\permissions.policy hw2.rmi.server.RmiEncodingServer
but I get a "class not found" exception as follows:
Exception in thread "main" java.lang.NoClassDefFoundError: ûclasspath
Caused by: java.lang.ClassNotFoundException: ûclasspath
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: GÇôclasspath. Program will exit.
where have I gone wrong?
also, if you can provide instructions on how to run the server in eclipse, I added the following as a VM argument, but I get a class not found exception to a class that is in the RmiServerCodeBase:
-Djava.security.policy=C:\workspace\distributedhw2\permissions.policy -Djava.rmi.server.codebase=file:/C:\workspace\distributedhw2\AgencyServers\RmiEncodingServer
thanks