All Examples
package examples.rmi.hello
about this package
This package takes the simple "HelloWorld" RMI example that is supplied
in the RMI distribution from Sun to illustrate how easy it is to convert
your RMI classes to use WebLogic RMI.
In this package is the Remote interface "Hello," which is implemented
by the "HelloImpl" class. The "HelloApplet" class invokes the Remote
class from an applet client; you use the HTML file of the same name
to call the applet.
Also included in this directory are build scripts for NT, Microsoft
SDK for Java, and UNIX. The
script compiles the files in this directory and runs the WebLogic RMI compiler
on the implementation class.
There are detailed instructions on converting Sun RMI classes to use
WebLogic RMI in the Developers Guide. The instructions here are brief
and assume that you have or will look at the Developers Guide.
This applet will not work if you are running the server using JDK 1.2 or
later since the web-browser is running an incompatible 1.1 JVM. If you wish to
deploy applets from a server running with JDK 1.2, we suggest you use the
Java Plug-in.
how to use this package
Configure the server:
- Register HelloImpl as a startup class in the
weblogic.properties file with the following property:
weblogic.system.startupClass.hello=examples.rmi.hello.HelloImpl
Build the example:
-
Set up your development shell, as described in
Setting up
your environment.
-
The build scripts are:
- build.cmd - JavaSoft JDK running on NT
- buildms.cmd - Microsoft SDK for Java
- build.sh - UNIX
Run the appropriate build script (build.cmd, build.sh for UNIX) as shown in this
example for the JavaSoft JDK running on NT:
$ build
- Copy the HelloApplet HTML file to a registered WebLogic
document root.
The HTML file is shipped with the CODEBASE attribute
set to "classes" which is the virtual name for the ClassPathServlet. The ClassPathServlet
serves classes from the CLASSPATH of the WebLogic Server.
The classes used in this example are placed in the
"/weblogic/myserver/serverclasses" directory, which you'll need to include
in the classpath of the Server when you start the Server.
If you move the classes to a different directory, you'll need to
add that directory to the classpath of the Server before starting it.
If you are having problems, see Troubleshooting CODEBASE.
Run the example:
- Start the WebLogic Server in a new command shell.
- Call the applet from a browser (make sure you don't have the
WebLogic classes in your browser's CLASSPATH if you're calling
the applet from the same machine that is hosting WebLogic). Use
the URL for your WebLogic Server and the document root where you placed
the HTML file, after the pattern:
http://hostname:port/HelloApplet.html
- hostname
- Host name of the WebLogic Server
- port
- Port where the WebLogic Server is listening for connections
(weblogic.system.ListenPort).
there's more . . .
Read more about this WebLogic service in the Developers Guide,
Using
WebLogic RMI.