Sun Java System Application Server |
<install_dir>/bin
to your path.
asant
"
under the source directory, e.g.
<install_dir>/samples/rmi-iiop/apps/simple/
<install_dir>/samples/rmi-iiop/apps/simple/rmi-simple.ear
Use the Admin Console or asadmin
to deploy the application
using the EAR file assembled in the previous section.
<install_dir>/bin
to your path.
<install_dir>/samples/rmi-iiop/apps/simple/
.
Execute asant deploy
This deploys the application in a server instance:
<install_dir>/domains/domain1/applications/j2ee-apps/rmi-simpleAn alternative way to deploy is to use Application Server Administration Tool.
asadmin deploy --user <username> --password <password> --host <host> --port <admin-port> rmi-simple.earYou can also use this to verify the registration:
asadmin list-components --user <username> --password <password>
Since a pre-built enterprise archive (.ear
)
file for the sample application is included with the application server,
you can use the Admin GUI to quickly read in the .ear
file and deploy
it to the application server.
http://<hostname>:<port>/rmi-iiop-simple/index.jsp
<install_dir>/samples/rmi-iiop/apps/simple/rmi-simpleClient.jar
<install_dir>/bin
<install_dir>/bin/appclient -client <path>/rmi-simpleClient.jar
On the first machine where application server is running, package ACC. Go to the directory of
<install_dir>/bin
package-appclient
<install_dir>/bin/appclient.jar
appclient.jar
and rmi-simpleClient.jar
from the first machine to the second machine.
The appclient.jar
fiel is intended to be used on a remote machine with same type
of operating system. For example, appclient.jar created on a Solaris system
will not function on a Win32 system.
applicient.jar
, under
a directory of your choice, e.g.
<acc_install_dir>
<acc_install_dir>/appclient
<acc_install_dir>/appclient/config/asenv.conf
AS_INSTALL=<acc_install_dir>/appclient AS_WEBSERVICES_LIB=<acc_install_dir>/appclient/lib AS_IMQ_LIB=<acc_install_dir>/appclient/imq/lib AS_ACC_CONFIG=<acc_install_dir>/appclient/config/sun-acc.xml AS_JAVA=<Location of JDK Installed>
<acc_install_dir>/appclient/bin/appclient
Ensure the path to the environment file, asenv.conf
is set to:
<acc_install_dir>/appclient/config/asenv.conf
<acc_install_dir>/appclient/config/sun-acc.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE client-container SYSTEM "file:<acc_install_dir>/appclient/lib/dtds/sun-application-client-container_1_0.dtd "> <client-container> <target-server name="acchost" address="ashost" port="3700"/> <client-credential user-name="j2ee" password="j2ee"/> <log-service file="" level="WARNING"/> </client-container>
ashost
and with default ORB-port 3700, and Application
Client Container is on the machine with hostname acchost. <acc_install_dir>/appclient/bin
<install_dir>/bin/appclient -client <path>/rmi-simpleClient.jar
...... INFO: ACC014: ORB host name: [ashost] ...... INFO: ACC013: ORB port number: [3700] ......
The java client is executed without using the interface of Application Client Container. By default it executes on the local machine. The client application runs from the command line:
java -classpath <CP> <ClientApp> <JNDIName>
where <CP> includes three jar files for CLASSPATH which are rmi-simpleClient.jar,
j2ee.jar and appserv-rt.jar.The file of rmi-simpleClient.jar is copied to the current directory
from the deployment directory,
<install_dir>/domains/<domain_name>/applications/j2ee-apps/rmi-simple
.
The files j2ee.jar and appserv-rt.jar are copied to the current
directory from AS installation, <install_dir>/lib
Ifyou intend to run the client application on a remote machine, you need to transfer the rmi-simpleClient.jar, j2ee.jar and appserv-rt.jar files to the client machine. Although the rmi-simpleClient.jar file is used in this example to run application client with or without an ACC, it contains more files than absolutely necessary for the situation in which an ACC is not used. The minimal files required to run the example on a remote machine without an ACC are the j2ee.jar and appserv-rt.jar file and the following files as extracted from the rmi-simpleClient.jar file:
The j2ee.jar file is required on the client machine because it contains the javax.ejb package that the client needs, and also contains the implementation and interface for J2EE APIs that the client may need.
<ClientApp> refers to the client program. In this example, it is
samples.rmi.simple.client.ConverterClient
.
<JNDIName> matches in the deployment file. In the example, it is rmiconverter
which can be found as <jndi-name>rmiconverter</jndi-name>
in the file
<install_dir>/samples/rmi-iiop/apps/simple/simple-ejb/src/conf/sun-ejb-jar.xml
.
As a complete example for the command, it looks like the following for this sample,
On Solaris:
java -classpath rmi-simpleClient.jar:j2ee.jar:appserv-rt.jar samples.rmi.simple.client.ConverterClient rmiconverter
On Windows:
java -classpath rmi-simpleClient.jar;j2ee.jar;appserv-rt.jar samples.rmi.simple.client.ConverterClient rmiconverter
After that, you should see the last two lines from screen as the result of converting 100 units of USD to Yen, and 100 Yen to Euro.
NOTE: To run the client from a remote machine you will need to pass org.omg.CORBA.ORBInitialHost=<remote
machine hostname> and org.omg.CORBA.ORBInitialPort=<ORB port of the remote
machine> for example: If you encounter problems when running the application, review the server log file at
Copyright © 2005 Sun Microsystems, Inc.
All rights reserved.
java
-Dorg.omg.CORBA.ORBInitialHost=<hostname>
-Dorg.omg.CORBA.ORBInitialPort=<port>
-classpath
./rmi-simpleClient.jar:/tmp/SUNWappserver/lib/appserv-rt.jar:/tmp/SUNWappserver/lib/j2ee.jar
samples.rmi.simple.client.ConverterClient
rmiconverter
Please replace <hostname>
and <port>
with actual remote machine name and ORB port (usually 3700).
Troubleshooting
domain_root_dirdomain_name/logs/server.log