Oracle® Containers for J2EE Configuration and Administration Guide
10g Release 3 (10.1.3) Part No. B14432-01 |
|
![]() Previous |
![]() Next |
This chapter provides instructions for installing OC4J, as well as for starting, stopping and restarting an OC4J instance. It includes the following sections:
You can start an OC4J server instance in a standalone environment using the default configuration with either the oc4j.jar
command line or one of the oc4j
executable scripts.
To start OC4J by invoking oc4j.jar
, issue the following command from the ORACLE_HOME/j2ee/home/
directory:
java -jar oc4j.jar [args]
Invoking oc4j.jar
as shown above starts OC4J using the default server.xml
configuration file, which you can find in the j2ee/home/config
directory. To start OC4J using a non-default version of the server.xml
file, issue the following command. Note that you must supply the path to the modified configuration file.
java -jar oc4j.jar -config /yourpath/server.xml [args]
Note that you can optionally pass in arguments at startup to set runtime options in OC4J. For an overview of valid arguments, see "Setting OC4J Runtime Options at Startup". You can also view the console help by issuing the following command from the ORACLE_HOME/j2ee/home
directory:
java -jar oc4j.jar -help
You can also set system properties on the JVM through the oc4j.jar
command line at OC4J startup. For details on setting system properties, see "Setting System Properties at Startup".
To start OC4J using the oc4j
scripts, issue the following command from the ORACLE_HOME/bin
directory:
oc4j -start
Note that the ORACLE_HOME and JAVA_HOME environment variables must be set to use this command. See "Standalone OC4J Installation Prerequisites" for details.
In a managed configuration, all Oracle Application Server components - including OC4J and OHS - should be started using opmnctl
, the OPMN command line tool. This tool is installed in the ORACLE_HOME/opmn/bin
directory.
Use the following command to start all OPMN managed processes, including OC4J, on a local Oracle Application Server instance:
opmnctl startall
Use the following command to start a specific managed processes - in this case OC4J - on a local Oracle Application Server instance:
opmnctl startproc ias-component=OC4J
Stop OC4J by invoking the -shutdown
command in the admin.jar
command-line utility or an oc4j.cmd
or oc4j
executable script.
Note: Operating system commands such asControl-C on Windows or kill on Unix/Linux machines should not be used to stop OC4J.
This is especially true when applications utilizing EJBs are actively running within OC4J, as such commands do not allow EJB method calls or timer operations to complete before shutting down the server. |
To stop OC4J using admin.jar
, issue the following command:
java -jar admin.jar ormi://oc4jHost:oc4jOrmiPort
adminId
adminPassword -shutdown [ordinary|force] [reason]
Note the following options that can be specified:
[ordinary | force]
The type of shutdown. The default is ordinary
, which allows each thread to terminate normally.
The force
option terminates all threads immediately. It is essentially the same as unplugging the host machine. If this option is used, the current state for clustered applications will not be replicated.
[
reason
]
You can optionally specify a reason for the shutdown as a string that is written to the ORACLE_HOME
/j2ee/home/log/server.log
file. Spaces are not allowed in the string.
The following example forces a shutdown of the OC4J server using admin.jar
, which terminates all threads immediately. Note the string entered as the reason
for the shutdown, which is written to the ORACLE_HOME/j2ee/home/config/server.log
file.
java -jar admin.jar ormi://localhost:23791 oc4jadmin password -shutdown force need_to_reboot_host_machine
To stop OC4J using one of the oc4j
scripts, issue the following command from the ORACLE_HOME/bin
directory. Note that you must supply the ORMI port used by OC4J, which is 23791
by default, as well as the password for the oc4jadmin
account.
oc4j -shutdown -port oc4jOrmiPort -password adminPassword
For example:
oc4j.cmd -shutdown -port 23791 -password adminpwd
Note that the ORACLE_HOME
and JAVA_HOME
environment variables must be set to use this command. See "Standalone OC4J Installation Prerequisites" for details.
In a managed configuration, all Oracle Application Server components - including OC4J and OHS - should be stopped using opmnctl
, the OPMN command-line tool. This tool is installed in the ORACLE_HOME
/opmn/bin
directory.
Use the following command to stop all OPMN-managed processes, including OC4J, on a local Oracle Application Server instance:
opmnctl stopall
Use the following command to stop a specific managed component - in this case OC4J - on a local Oracle Application Server instance:
opmnctl stopproc ias-component=OC4J
You can restart OC4J using the admin.jar
command-line utility. Restart OC4J by executing the following command:
java -jar admin.jar ormi://oc4jHost:oc4jOrmiPort adminId adminPassword -restart [reason]
Note that you can optionally enter a string as the value for [
reason
]
. The string is written to the ORACLE_HOME
/j2ee/home/config/server.log
file.
In a managed configuration, all Oracle Application Server components - including OC4J and OHS - should be restarted using opmnctl
, the OPMN command line tool. This tool is installed in the ORACLE_HOME/opmn/bin
directory.
Use the following command to restart all OPMN managed processes, including OC4J, on a local Oracle Application Server instance:
opmnctl startall
Use the following command to restart a specific managed processes - in this case OC4J - on a local Oracle Application Server instance:
opmnctl restartproc ias-component=OC4J