Oracle® Containers for J2EE Configuration and Administration Guide
10g Release 3 (10.1.3) Part No. B14432-01 |
|
![]() Previous |
![]() Next |
This chapter provides details on runtime options and system properties that can be set at OC4J startup. It includes the following topics:
OC4J requires the Java 2 Platform, Standard Edition (J2SE) Development Kit (JDK) release 1.4.2 or 5.0. You can specify the JDK version to use for a standalone OC4J configuration, as well as for each OC4J instance in an Oracle Application Server installation.
In a standalone OC4J configuration, set the JAVA_HOME
environment variable to the location of the JDK you wish to be used by OC4J. Note that the JDK that will be used must be added to the host machine's PATH.
Alternatively, you can specify the JDK to use at OC4J startup. For example:
C:\ORACLE_HOME\j2ee\home\C:\jdk\bin\java -jar oc4j.jar
An OPMN-managed OC4J instance installed as a component of Oracle Application Server will use the JDK 5.0 by default. This new version of the JDK is required to utilize EJB 3.0 and offers numerous performance improvements. However, if applications that will be deployed to OC4J require a JDK 1.4.2 release, it may be necessary to "downgrade" to the earlier version.
Before switching from JDK 5.0 to JDK 1.4.2, you must remove all compiled application files from the OC4J instance. To do this:
Stop the OC4J instance.
Delete the ORACLE_HOME
/j2ee/
instance
/application-deployments
directory.
Deleting this directory will cause the application files to be re-compiled when OC4J is re-started with the JDK 1.4.2.
You can specify the JDK to use for each OC4J instance through manual edits to the opmn.xml
configuration file.
Set Java system properties in the <data>
element where the id
attribute is "java-bin"
. This <data>
element is enclosed within the <category id="start-parameters">
subelement of the <ias-component id="OC4J">
element in the XML structure. For example:
<ias-component id="OC4J"> <process-type id="home" module-id="OC4J" status="enabled"> <module-data> <category id="start-parameters"> <data id="java-bin" value="c:/myhost/jdk/bin/java"/> </category> ... </module-data> </process-type> </ias-component>
A number of OC4J runtime options can be set on OC4J instances at OC4J startup, most providing options for managing standard output messages. How these options are set differs for standalone OC4J and managed Oracle Application Server configurations.
OC4J runtime options can be set by passing arguments on the oc4j.jar
command line at OC4J startup. The syntax for oc4j.jar
is as follows:
java [props] -jar oc4j.jar [args]
Note that runtime options ([args]
) are specified after oc4j.jar
in the syntax. For example:
java -jar oc4j.jar -validateXML -verbosity 10
When OC4J is installed as a component of Oracle Application Server, OC4J runtime options must be manually added to the opmn.xml
configuration file. Options will be passed to managed OC4J instances at startup.
Set Java system properties in the <data>
element where the id
attribute is "oc4j-options"
. This <data>
element is enclosed within the <category id="start-parameters">
subelement of the <ias-component id="OC4J">
element in the XML structure. Preface all system properties with a -D
. For example:
<ias-component id="OC4J"> <process-type id="home" module-id="OC4J" status="enabled"> <module-data> <category id="start-parameters"> <data id="oc4j-options" value="-validateXML -verbosity 10"/> ... </category> ... </module-data> </process-type> </ias-component>
Table 4-1 describes the OC4J runtime options.
Table 4-1 OC4J Startup Options
Command-Line Argument | Description |
---|---|
-quiet
|
Suppresses standard output to the console. |
-config path
|
Specifies the path to the server.xml descriptor file. The default location is the ORACLE_HOME /j2ee/home/config directory.
|
-validateXML
|
Validates XML configuration files defined by an XSD at the time they are read. |
-out [ file ]
|
Specifies a file to route the standard output to. The file contains messages that are printed to System.out , as well as the messages sent to output through the servlet logging interface. If not specified, all output is written to standard out.
See "Managing stdout/stderr Log Files" for additional system properties that can be set to manage Note that in an OPMN-managed configuration, the file will be generated within an instance_default_group_1 directory appended to the path specified. For example, if you specify the following in <data id="oc4j-options" value=" ... -out /mypath/mylog.log" /> The /mypath/instanceName_default_group_1/mylog.log |
-err [ file ]
|
Specifies a file to route standard error output to. The file contains messages that are printed to System.err . If not specified, all errors are written to standard error.
See "Managing stdout/stderr Log Files" for additional system properties that can be set to manage Note that in an OPMN-managed configuration, the file will be generated within an instance_default_group_1 directory appended to the path specified. See the |
-verbosity int
|
Define an integer between 1 and 10 to set the verbosity level of the message output. A value of 10 will produce the most verbose output. For example:
java -jar oc4j.jar -verbosity 10 |
-monitorResourceThreads
|
Enables backup debugging of thread resources. Enable only if you have problems with threads getting stuck in critical sections of code. |
-userThreads
|
Enables context lookup support from user-created threads. |
-listProperties
|
Outputs a list of all of the OC4J-specific system properties that can be set on the JVM at OC4J startup, then exits. The following example will redirect the output to a text file in the working directory:
java -jar oc4j.jar -listProperties > props.txt |
-version
|
Returns the installed version of OC4J and exits |
-? |-help
|
Prints the help text for these options to the console. |
You can set a number of OC4J-specific system properties on the JVM at OC4J startup.
Setting System Properties in a Standalone OC4J Configuration
Setting System Properties in an OPMN-Managed OC4J Configuration
Note: You can output a list of all of the OC4J-specific system properties that can be set on the JVM at OC4J startup using theoc4j.jar -listProperties option. The following example will redirect the output to a text file in the working directory:
java -jar oc4j.jar -listProperties > props.txt |
You can set system properties on the JVM through the OC4J command line at startup. If OC4J is running, you must restart the instance for new property settings to take effect.
The syntax is as follows:
java [props] -jar oc4j.jar [args]
Note that all system properties ([props]
) are specified before oc4j.jar
in the syntax. All system properties must be prefaced on the command line with a -D
. For example:
java -DGenerateIIOP=true -Dhttp.session.debug=true -jar oc4j.jar
When OC4J is installed as a component of Oracle Application Server, OC4J system properties must be manually added to the opmn.xml
configuration file. Options will be passed to managed OC4J instances at startup.
Set Java system properties in the <data>
element where the id
attribute is "java-options"
. This <data>
element is enclosed within the <category id="start-parameters">
subelement of the <ias-component id="OC4J">
element in the XML structure. Preface all system properties with a -D
. For example:
<ias-component id="OC4J"> <process-type id="home" module-id="OC4J" status="enabled"> <module-data> <category id="start-parameters"> <data id="java-options" value="-DGenerateIIOP=true -Dhttp.session.debug=true"/> </category> ... </module-data> </process-type> </ias-component>
The following table describes the general system properties that can be set for OC4J.
Table 4-2 -D General System Properties for OC4J
Note: The debug properties listed in this section are deprecated in Oracle Containers for J2EE 10g Release 3 (10.1.3).See "Using and Configuring the OC4J Component Loggers" for details on using the component loggers provided with OC4J. |
Use the following properties to better debug applications running within OC4J. Debug messages are printed to the console. All properties take a Boolean value.
Preface all properties with a -D
.
Table 4-3 OC4J Debug Properties
The following properties are used to manage standard stderr
and stdout
log files.
The type of log file(s) that the properties pertain to are specified with the -out
and/or -err
command line options. You can also set a location to output these log files to in these options.
For example, set the following to rotate stdout
/stderr
files when the file size reaches 2.5 MB. Log files will be output to the D:\logs
directory.
java -Dstdstream.filesize=2.5 -jar oc4j.jar -out d:\logs\oc4j.out -err d:\logs\oc4j.err
This example will rotate stdout
logs at 2:30 p.m. every day and limit the archive to a maximum of 10 files:
java -Dstdstream.rotatetime=14:30 -Dstdstream.filenumber=10 -jar oc4j.jar -out d:\logs\oc4j.out
Table 4-4 stdout/stderr Archive Management Properties