Project repo for SFSU CSC668/868
compile src from src/ directory:
javac com/post/registry/ServerReg.java \
com/post/server/ProductReader.java \
com/post/client/CashPayment.java \
com/post/server/PostManagerImpl.java \
com/post/server/ProductSpecificationImpl.java
usage:
-
Start RMI registry:
- rmiregistry -J-Djava.security.policy=com/post/registry/permission.policy &
-
Register remote object:
- java -Djava.rmi.server.hostname=localhost -Djava.security.policy=com/post/registry/permission.policy com/post/registry/ServerReg
-
In netbeans/eclipse
- set VM options: -Djava.security.policy=com/post/presentation/permission.policy
- set working directory to src/
- run MainFrame class
-
to test new server-side code, you have to tear down the rmiregistry, recompile server code, restart rmiregistry and register remote object again
-
to kill rmiregistry
- issue command:
ps
[this will list user processes] - find the one that looks something like this:
28304 ttys000 0:00.88 /usr/bin/rmiregistry -J-Djava.security.policy=com/post/registry/permission.policy
- in this case, process ID = 28304
- kill process with ```kill 28304````
Alternatively you can also follow the following steps:
- Go to the same prompt where you had started the registry. If you haven't notice
&
make the command run in background. just typefg
. It brings the command in foreground. - Once command is foreground, you can press
ctrl+C
to kill the process.
- issue command:
-
If you get any
class not found
exceptions, you need to recompile the source with javac [what ever class is not found]