|
RMI-IIOPHello SampleIBM Developer Kit for Windows(R) Java(TM) 2 Technology Edition, Version 1.2.2Copyright © 1999 Sun Microsystems, Inc.
|
Note: Don't forget to set up a security policy file. See the following section for instructions.
The RMI section in the Java Tutorial contains a discussion of policy files.grant { permission java.security.AllPermission; };
javac *.java
cd ..
rmic hello.RemoteHelloServer
rmic -iiop hello.RemoteHelloServer
rmiregistryStart the registry in its own window. Remember to run rmi-iiop in the new window before running the registry.
tnameserv
java -Djava.rmi.server.codebase=http://aslan.narnia.com/java/ -Djava.security.policy=policy -Djava.naming.factory.initial=com.sun.jndi.rmi.registry.RegistryContextFactory hello.RemoteHelloServer
java -Djava.rmi.server.codebase=http://aslan.narnia.com/java/ -Djava.security.policy=policy -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory hello.RemoteHelloServer
java -Djava.rmi.server.codebase=http://aslan.narnia.com/java/ -Djava.security.policy=policy -Djava.naming.factory.initial=com.sun.jndi.rmi.registry.RegistryContextFactory hello.RemoteHelloApplication aslan.narnia.com
java -Djava.rmi.server.codebase=http://aslan.narnia.com/java/ -Djava.security.policy=policy -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory hello.RemoteHelloApplication aslan.narnia.com
appletviewer http://aslan.narnia.com/jrmp.html
appletviewer http://aslan.narnia.com/iiop.html
Exception | Probable Cause |
---|---|
java.lang.ClassCastException | The stub class file cannot be found in the client class path |
java.lang.NoClassDefFound | The interface class file cannot be found in the client class path |
java.rmi.ConnectException | Either the server has not been started or you are running a client for the wrong protocol |