Skip Headers

Oracle Application Server Containers for J2EE User's Guide
10g (9.0.4)

Part Number B10322-01
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

A
Additional Information

This appendix contains complete information about the following topics:

Most of these sections discuss how to modify your XML files. Modify all XML files only through Oracle Enterprise Manager. Do not modify XML files on a single node.

Description of XML File Contents

OC4J uses configuration and deployment XML files. The following sections describe each of these files and their function.

OC4J Configuration XML Files

This section describes the following XML files, which are necessary for OC4J configuration:

server.xml

This file contains the configuration for the application server. The server.xml file is the root configuration file--it contains references to other configuration files. In this file, specify the following:

default-web-site.xml

This file contains the configuration for a Web site. In the default-web-site.xml file, specify the following:

jazn-data.xml

This file contains security information for the OC4J server. It defines the user and group configuration for employing the default JAZNUserManager. In the jazn-data.xml file, specify the following:

principals.xml

This file contains security information for the OC4J server. It defines the user and group configuration for employing the XMLUserManager, which is no longer the default security manager. In the principals.xml file, specify the following:

data-sources.xml

This file contains configuration for the data sources that are used. In addition, it contains information on how to retrieve JDBC connections. In the data-sources.xml file, specify the following:

jms.xml

This file contains the configuration for the OC4J Java Message Service (JMS) implementation. In the jms.xml file, specify the following:

rmi.xml

This file contains configuration for the Remote Method Invocation (RMI) system. It contains the setting for the RMI listener, which provides remote access for EJBs. In the rmi.xml file, specify the following:

J2EE Deployment XML Files

The OC4J-specific deployment XML files contain deployment information for different components. If you do not create the OC4J-specific files, they are automatically generated when the application is deployed. You can edit OC4J-specific deployment XML files manually. OC4J uses these files to map environment entries, resources references, and security-roles to actual deployment-specific values.

This section describes the following XML files necessary for J2EE application deployment:

The J2EE application.xml File

This file identifies the Web or EJB applications that are contained within the J2EE application. See "Elements in the application.xml File" for a list of the elements.

The OC4J-Specific orion-application.xml File

This file configures the global application. In the orion-application.xml file, specify the following:

See "Elements in the orion-application.xml File" for a list of the elements.

The J2EE ejb-jar.xml File

This file defines the deployment parameters for the EJBs in this JAR file. See the Sun Microsystems EJB specification for a description of these elements.

The OC4J-Specific orion-ejb-jar.xml File

This file is the OC4J-specific deployment descriptor for EJBs. In the orion-ejb-jar.xml file, specify the following:

See the appendix in the Oracle Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide for description of the elements.

The J2EE web.xml File

This file contains deployment information about the servlets and JSPs in this application. See the Sun Microsystems specifications for a description of these elements.

The OC4J-Specific orion-web.xml File

This is the OC4J-specific deployment descriptor for mapping Web settings. This XML file contains the following:

See the appendix in the Oracle Application Server Containers for J2EE Servlet Developer's Guide for description of the elements.

The J2EE application-client.xml File

This file contains JNDI information for accessing the server application and other client information. See "Elements in the application-client.xml File" for a list of the elements.

The OC4J-Specific orion-application-client.xml File

This OC4J-specific deployment file is for the client application. It contains JNDI mappings and entries for the client. See "Elements in the orion-application-client.xml File" for a list of the elements.

Elements in the server.xml File

The server.xml file is where you perform the following tasks:

Configure OC4J

Configuring the OC4J server includes defining the following elements in the server.xml file:

Reference Other Configuration Files

Referencing other configuration files in the server.xml file includes specifying the following:

Several XML files and directories are defined in the server.xml file. The path to these files or directories can be relative or absolute. If relative, the path should be relative to the location of the server.xml file.

<application-server> Element Description of the server.xml file

The top level element of the server.xml file is the <application-server> element.

<application-server>

This element contains the configuration for an application server.

Attributes:

Elements Contained Within <application-server> of the server.xml file

Within the <application-server> element, the following elements, which are listed alphabetically and not by DTD ordering, can be configured:

<application>

An application is a entity with its own set of users, Web applications, and EJB JAR files.

Attributes:

<compiler>

This element is deprecated for version 9.0.4 and forward. See the <java-compiler> element for the alternative. For previous releases, it specifies an alternative compiler (such as Jikes) for EJB/JSP compiling.

Attributes:

<cluster>

Cluster settings for this server.

Attribute:

<execution-order>

Defines the ordering of how the startup classes are executed. Value is an integer. OC4J loads from 0 on up. If duplicate numbers, OC4J chooses the ordering for those classes.

<global-application>

The default application for this server. This acts as a parent to other applications in terms of object visibility.

Attributes:

<global-thread-pool>

You can specify unbounded, one, or two thread pools for an OC4J process through this element. If you do not specify this element, then an infinite number of threads can be created. See "Thread Pool Settings" for a full description.

Attributes:

<global-web-app-config>

Attributes:

<init-library>

Attributes:

<init-param>

Attributes:

<javacache-config>

Attributes:

<java-compiler>

You can specify an alternative compiler--either in or out of process--for your JSP and EJB compilation. The default compiler is an out of process javac compiler found in the JDK bin directory.

Attributes:

The following are four examples of how to define alternate compilers in this element:

<java-compiler name="jikes" bindir="C:\java\jikes\bin" 
	in-process="false" />
<java-compiler name="ojc" bindir="C:\java\jdev\jdev\bin" 
	in-process="false"/>
<java-compiler name="classic" in-process="true" />
<java-compiler name="modern" in-process="true" />

<jms-config>

Attribute:

<log>

<max-http-connections>

Used to define the maximum number of concurrent connections any given Web site can accept at a single point in time. If text exists inside the tag, it is used as a redirect-URL when the limit is reached.

Attributes:

<rmi-config>

Attribute:

<sep-config>

The <sep-config> element in this file specifies the pathname, normally internal-settings.xml, for the server extension provider properties.

Attribute:

<sfsb-config>

Passivation for stateful session beans is automatically done, unless you set the enable-passivation attribute for this element to false. For more information on stateful session bean passivation, see the Advanced chapter in the Oracle Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide.

Attribute

<shutdown-classes>

Shutdown classes can be defined by the user, and are executed after undeployment, but before the core services are stopped.

<shutdown-class>

Each startup class is defined within the <startup-class> element.

Attributes:

<startup-classes>

Startup classes can be defined by the user, and will be executed after the core services (JMS, RMI) are started, but before applications are deployed. The shutdown classes are executed after undeployment, but before the core services are stopped.

<startup-class>

Each startup class is defined within the <startup-class> element.

Attributes:

<transaction-config>

Transaction configuration for the server.

Attribute:

<web-site>

Attribute:

Elements in the application.xml File

<application> Element Description of the application.xml file

The top level element of the application.xml file is the <application> element.

Elements Contained Within <application> of the application.xml file

Within the <application> element, the following elements, which are listed alphabetically and not by DTD ordering, can be configured:

<alt-dd>path/to/dd</alt-dd>

The alt-dd element specifies an optional URI to the post-assembly version of the deployment descriptor file for a particular J2EE module. The URI must specify the full pathname of the deployment descriptor file relative to the application's root directory. If alt-dd is not specified, the deployer must read the deployment descriptor from the default location and file name required by the respective component specification.

<connector>context</connector>

The connector element specifies the URI of a resource adapter archive file, relative to the top level of the aplication package.

<context-root>thedir/</context-root>

The context-root element specifies the context root of a web application.

<description>A description.</description>

The description element provides a human readable description of the application. The description element should include any information that the application assembler wants to provide the deployer.

<display-name>The name.</display-name>

The display-name element specifies an application name. The application name is assigned to the application by the application assembler and is used to identify the application to the deployer at deployment time.

<ejb>pathToEJB.jar</ejb>

The ejb element specifies the URI of a EJB JAR, relative to the top level of the application package.

<icon>

The icon element contains a small-icon and a large-icon element which specify the location within the application for a small and large image used to represent the application in a GUI tool.

<java>pathToClient.jar</java>

The java element specifies the URI of a Java application client module, relative to the top level of the application package.

<large-icon>path/to/icon.gif</large-icon>

The large-icon element contains the location within the application of a file containing a large (32x32 pixel) icon image. The image must be either GIF or JPEG format and the filename must end with the extension of ".gif" or ".jpg".

<module>

The module element represents a single J2EE module and contains an EJB, Java, or Web element, which indicates the module type and contains a path to the module file, and an optional alt-dd element, which specifies an optional URI to the post-assembly version of the deployment descriptor. The application deployment descriptor must have one module element for each J2EE module in the application package.

<role-name>nameOfRole</role-name>

The name of the role.

<security-role>

The security-role element contains the definition of a security role which is global to the application. The definition consists of a description of the security role, and the security role name. The descriptions at this level override those in the component level security role definitions and must be the descriptions tool display to the deployer.

<small-icon>path/to/icon.gif</small-icon>

The small-icon element contains the location within the application of a file containing a small (16x16 pixel) icon image. The image must be either GIF or JPEG format and the filename must end with the extension of ".gif" or ".jpg".

<web>

The web element contains the web-uri and context-root of a Web application module.

<web-uri>pathTo.war</web-uri>

The web-uri element specifies the URI of a web application file, relative to the top level of the application package.

Elements in the orion-application.xml File

<orion-application> Element Description of the orion-application.xml file

The top level element of the orion-application.xml file is the <orion-application> element.

Attributes:

Elements Contained Within <orion-application> of the orion-application.xml file

Within the <orion-application> element, the following elements, which are listed alphabetically and not by DTD ordering, can be configured:

<argument value="theValue" />

An argument used when invoking the client.

Attribute:

<arguments>

A list of arguments to used when invoking the application client if starting it in-process (auto-start="true").

<client-module auto-start="true|false" deployment-time="073fc2ab513bc3ce" path="myappclient.jar" user="theUser">

An application client module of the application. An application client is a GUI or console-based standalone client that interacts with the server.

Attributes:

<commit-coordinator>

Configure the two-phase commit engine.

<commit-class class="com.evermind.server.OracleTwoPhaseCommitDriver" />

Attribute:

<connectors path="./oc4j-connectors.xml" />

Attribute:

<data-sources path="./data-sources.xml" />

Attribute:

<description>A short description</description>

A short description of this component.

<ejb-module path="myEjbs.jar" remote="true|false" />

An EJB JAR module of the application.

Attributes:

<file path="../log/server.log" />

A relative/absolute path to log events to.

Attribute:

<group name="theGroup" />

A group that this security-role-mapping implies. That is, all members of the specified group are included in this role.

Attribute:

<jazn provider="XML" location="./jazn-data.xml" />

Configure the OracleAS JAAS Provider to use the XML-based provider type.

Attributes:

<jazn-web-app auth-method="SSO" runas-mode="false" doasprivileged-mode="true" />

The filter element of JAZNUserManager.

Attributes:

<library path="../lib/" />

A relative/absolute path/URL to a directory or a JAR/ZIP to add as a library-path for this server. Directories are scanned for JARS/ZIP files to include at startup.

Attribute:

<log>

Logging settings.

<mail address="my@mail.address" />

An e-mail address to log events to. A valid mail-session also needs to be specified if this option is used.

Attribute:

<mail-session location="mail/TheSession" smtp-host="smtp.server.com">

The session SMTP-server host (if using SMTP).

Attributes:

<namespace-access>

Namespace (naming context) security policy for RMI clients.

<namespace-resource root="the/path">

A resource with a specific security setting.

Attribute:

<password-manager>

Specifies the UserManager that is used for the lookup of hidden passwords. If omitted, the current UserManager is used for authentication and authorization. For example, you can use a OracleAS JAAS Provider LDAP UserManager for the overall UserManager, but use a OracleAS JAAS Provider XML UserManager for checking hidding passwords.

To identify a UserManager, provide a <jazn> element definition within this element, as follows:

<password-manager>
	<jazn ...>
</password-manager>

<persistence path="./persistence" />

A relative (to the application root) or absolute path to a directory where application state should be stored across restarts.

Attribute:

<principals path="principals.xml" />

Attribute:

<property name="theName" value="theValue" />

Contains a name/value pair initialization param.

Attributes:

<read-access>

The read-access policy.

<resource-provider>

Define a JMS resource provider. To add a custom <resource-provider>, add the following to your orion-application.xml file:

<resource-provider class="providerClassName" name="JNDI name"> 
  <description> description </description> 
  <property name="name" value="value" /> 
</resource-provider>

In place of the user-replaceable constructs (those in italics) in the preceding code, do the following:

<security-role-mapping impliesAll="true|false" name="theRole">

The runtime mapping (to groups and users) of a role. Maps to a security-role of the same name in the assembly descriptor.

Attributes:

<user name="theUser" />

A user that this security-role-mapping implies.

Attribute:

<user-manager class="com.name.of.TheUserManager" display-name="Friendly UserManager name">

Specifies an optional user-manager to use. For example, user-managers are com.evermind.sql.DataSourceUserManager, com.evermind.ejb.EJBUserManager, and so on. These are used to integrate existing systems and provide custom user-managers for Web applications.

Attributes:

<web-module id="myWebApp" path="myWebApp.war" />

A Web application module of the application. Each Web application can be installed on any site and in any context on those sites (for instance http://www.myserver.com/myapp/).

Attributes:

<write-access>

The write access policy.

Elements in the application-client.xml File

<application-client> Element Description of the application-client.xml file

The top level element of the application-client.xml file is the <application-client> element.

<application-client>

The application-client element is the root element of an application client deployment descriptor. The application client deployment descriptor describes the EJB components and external resources referenced by the application client.

Elements Contained Within <application-client> of the application-client.xml file

Within the <application-client> element, the following elements, which are listed alphabetically and not by DTD ordering, can be configured:

<callback-handler>

The callback-handler element names a class provided by the application. The class must have a no args constructor and must implement the javax.security.auth.callback.CallbackHandler interface. The class will be instantiated by the application client container and used by the container to collect authentication information from the user.

<description>The description</description>

A short description.

<display-name>The name</display-name>

The display-name element contains a short name that is intended to be displayed by tools.

<ejb-link>EmployeeRecord</ejb-link>

The ejb-link element is used in the ejb-ref element to specify that an EJB reference is linked to an enterprise bean in the encompassing J2EE Application package. The value of the ejb-link element must be the ejb-name of an enterprise bean in the same J2EE Application package.

<ejb-ref>

The ejb-ref element is used for the declaration of a reference to an enterprise bean's home. The declaration consists of an optional description; the EJB reference name used in the code of the referencing application client; the expected type of the referenced enterprise bean; the expected home and remote interfaces of the referenced enterprise bean; and an optional ejb-link information. The optional ejb-link element is used to specify the referenced enterprise bean.

<ejb-ref-name>ejb/Payroll</ejb-ref-name>

The ejb-ref-name element contains the name of an EJB reference. The EJB reference is an entry in the enterprise bean's environment. It is recommended that name is prefixed with "ejb/".

<ejb-ref-type>Entity/Session</ejb-ref-type>

The ejb-ref-type element contains the expected type of the referenced enterprise bean. The ejb-ref-type element must be one of the following: Entity Session

<env-entry>

The env-entry element contains the declaration of an Enterprise JavaBean's environment entries. The declaration consists of an optional description, the name of the environment entry, and an optional value.

<env-entry-name>minAmount</env-entry-name>

The env-entry-name element contains the name of an Enterprise JavaBean's environment entry.

<env-entry-type>java.lang.String</env-entry-type>

The env-entry-type element contains the fully-qualified Java type of the environment entry value that is expected by the enterprise bean's code. The following are the legal values of env-entry-type: java.lang.Boolean, java.lang.String, java.lang.Integer, java.lang.Double, java.lang.Byte, java.lang.Short, java.lang.Long, and java.lang.Float.

<env-entry-value>100.00</env-entry-value>

The env-entry-value element contains the value of an Enterprise JavaBean's environment entry.

<home>com.aardvark.payroll.PayrollHome</home>

The home element contains the fully-qualified name of the Enterprise JavaBean's home interface.

<icon>

The icon element contains a small-icon and large-icon element which specify the URIs for a small and a large GIF or JPEG icon image used to represent the application client in a GUI tool.

<large-icon>lib/images/employee-service-icon32x32.jpg
</large-icon>

The large-icon element contains the name of a file containing a large (32 x 32) icon image. The file name is a relative path within the application client JAR file. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg" or ".gif" respectively. The icon can be used by tools.

<remote>com.wombat.empl.EmployeeService</remote>

The remote element contains the fully-qualified name of the Enterprise JavaBean's remote interface.

<res-auth>Application/Container</res-auth>

The res-auth element specifies whether the Enterprise JavaBean code signs on programmatically to the resource manager, or whether the Container will sign on to the resource manager on behalf of the bean. In the latter case, the Container uses information that is supplied by the Deployer. The value of this element must be one of the two following: Application or Container

<resource-env-ref>

The resource-env-ref element contains a declaration of an application's reference to an administered object associated with a resource in the application's environment. It consists of an optional descrioption, the resource environment reference name, and an indication of the resource environment reference type expected by the application code.

<resource-env-ref-name>

The resource-env-ref-name element specifies the name of a resource environment entry name used in the application code.

<resource-env-ref-type>

The resource-env-ref-type element specifies the type of a resource environment reference.

<resource-ref>

The resource-ref element contains a declaration of Enterprise JavaBean's reference to an external resource. It consists of an optional description, the resource factory reference name, the indication of the resource factory type expected by the enterprise bean code, and the type of authentication (Bean or Container).

<res-ref-name>name</res-ref-name>

The res-ref-name element specifies the name of a resource factory reference.

<res-sharing-scope>Shareable</res-sharing-scope>

The res-sharing-scope element specifies whether connections obtained through the given resource manager connection factory reference can be shared. The value of this element, if specified, must be one of the following: Shareable or Unshareable. The default value is Shareable.

<res-type>javax.sql.DataSource</res-type>

The res-type element specifies the type of the data source. The type is specified by the Java interface (or class) expected to be implemented by the data source.

<small-icon>lib/images/employee-service-icon16x16.jpg
</small-icon>

The small-icon element contains the name of a file containing a small (16 x 16) icon image. The file name is a relative path within the application client JAR file. The image must be either in the JPEG or GIF format, and the file name must end with the suffix ".jpg" or ".gif" respectively. The icon can be used by tools.

Elements in the orion-application-client.xml File

<orion-application-client> Element Description

The top level element of the orion-application-client.xml file is the <orion-application-client> element.

<orion-application-client>

An orion-application-client.xml file contains the deploy time information for a J2EE application client. It complements the application client assembly information found in application-client.xml.

Elements Contained Within <orion-application-client>

Within the <orion-application-client> element, the following elements, which are listed alphabetically and not by DTD ordering, can be configured:

<context-attribute name="name" value="value" />

An attribute sent to the context. The only mandatory attribute in JNDI is the 'java.naming.factory.initial,' which is the classname of the context factory implementation.

Attributes:

<ejb-ref-mapping location="ejb/Payroll" name="ejb/Payroll" />

The ejb-ref element is used for the declaration of a reference to another enterprise bean's home. The ejb-ref-mapping element ties this to a JNDI-location when deploying.

Attributes:

<env-entry-mapping name="theName">deploymentValue</env-entry-mapping>

Overrides the value of an env-entry in the assembly descriptor. It is used to keep the EAR (assembly) clean from deployment-specific values. The body is the value.

Attributes:

<lookup-context location="foreign/resource/location">

The specification of an optional javax.naming.Context implementation used for retrieving the resource. This is useful when hooking up with third party modules, such as a third party JMS server for instance. Either use the context implementation supplied by the resource vendor or if none exists write an implementation which in turn negotiates with the vendor software.

Attributes:

<resource-env-ref-mapping location="jdbc/TheDS" >

The resource-env-ref element is used for the declaration of a reference to an external resource, such as a data source, JMS queue, mail session, or similar. The resource-env-ref-mapping ties that element to a JNDI location during deployment.

Attributes:

<resource-ref-mapping location="jdbc/TheDS" name="jdbc/TheDSVar">

The resource-ref element is used for the declaration of a reference to an external resource such as a data source, JMS queue, mail session or similar. The resource-ref-mapping ties this to a JNDI-location when deploying.

Attributes:

Configuration and Deployment Examples

The following example shows how to configure and deploy a J2EE application within OC4J. See "Deploying Applications" to learn how to modify the XML configuration files for the FAQ demo.

In this example, the myapp application contains a Java client, an EJB assembled into a JAR file, servlets and JSPs assembled into a WAR file, and an EAR file that contains both the EJB JAR file and the Web application WAR file. The tree structure showing the location of all the XML configuration files, the Java class files, and the JSP files is shown in Figure A-1. Notice that you can separate all the configuration files into logical directories within the application directory.

Figure A-1 Application EAR Structure

Text description of apdx_aa.gif follows

Text description of the illustration apdx_aa.gif

application.xml Example

The myapp/META-INF/application.xml file lists the EJB JAR and Web application WAR file that is contained in the EAR file using the <module> elements.

<?xml version="1.0"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE 
Application 1.3//EN" 
"http://java.sun.com/j2ee/dtds/application_1_3.dtd">
<application>
  <display-name>myapp j2ee application</display-name>
  <description>
     A sample J2EE application that uses a Container Managed
     Entity Bean and JSPs for a client.
  </description>
  <module>
    <ejb>myapp-ejb.jar</ejb>
  </module>
  <module>
    <web>
      <web-uri>myapp-web.war</web-uri>
      <context-root>/myapp</context-root>
    </web>
  </module>
</application>

web.xml Example

The myapp/web/WEB-INF/web.xml file contains the class definitions for EJBs, servlets, and JSPs that are executed within the Web site. The myapp Web module specifies the following in its descriptor:

The Web server looks for the following:

ejb-jar.xml Example

The ejb-jar.xml file contains the definitions for a container-managed persistent EJB. The myapp EJB deployment descriptor contains the following:

server.xml Addition

When you deploy the application using the deployment wizard, this adds the location of the application EAR file to the server.xml file. This causes the application to be started every time that OC4J is started. If you do not want the application to be started with OC4J, change the auto-start variable to FALSE.


Note:

If you set auto-start to FALSE, you can manually start the application through Oracle Enterprise Manager or it is automatically started when a client requests the application.


<application name="myapp" path="../myapp/myapp.ear" 
auto-start="true" />

where

default-web-site.xml Addition

The deployment wizard defines the root context for the Web application and binds the Web context and adds the following to the default-web-site.xml file:

<web-app application="myapp" name="myapp-web" root="/myapp" /> 

Client Example

The application client that accesses the myapp application has a descriptor, which describes where to find the EJB stubs (home and remote interface) and its JNDI name.

The client XML configuration is contained in two files: application-client.xml and orion-application-client.xml.

The application-client.xml file contains a reference for an EJB, as follows:

<application-client>
	<display-name>TemplateBean</display-name>
	<ejb-ref>
		<ejb-ref-name>TemplateBean</ejb-ref-name>
		<ejb-ref-type>Entity</ejb-ref-type>
		<home>mTemplateHome</home>
		<remote>Template</remote>
	</ejb-ref>
</application-client>

The orion-application-client.xml file maps the EJB reference logical name to the JNDI name for the EJB. For example, this file maps the <ejb-ref-name> element, "TemplateBean," defined in the application-client.xml, to the JNDI name, "myapp/myapp-ejb/TemplateBean", as follows:

<orion-application-client>
	<ejb-ref-mapping name="TemplateBean" 
location="myapp/myapp-ejb/TemplateBean" />
</orion-application-client>
JNDI Properties for the Client

Set the JNDI properties for a regular client so it finds the initial JNDI context factory in one of the following manners:

Client Module--Standalone Java Client Invoking EJBs

Package your client module in a JAR file with the descriptor META-INF/application-client.xml.

Manifest File for the Client

Package the client in a runable JAR with a manifest that has the main class to run and required CLASSPATH, as shown below. Check that the relative paths in this file are correct. Verify that you point to the relative location of the required OC4J class libraries.

manifest.mf
-----------
Manifest-Version: 1.0
Main-Class: myapp.myapp-client.TemplateClient
Name: "TemplateClient"
Created-By: 1.2 (Sun Microsystems Inc.)
Implementation-Vendor: "Oracle"
Class-Path: ../../../j2ee/home/oc4J.jar ../../../j2ee/home/jndi.jar 
../../../j2ee/home/ejb.jar ../myapp-ejb.jar
Executing the Client

To execute the client, perform the following:

% java -jar myapp-client.jar 
TemplateClient.main(): start
Enter integer value for col_1: 1
Enter string value for col_2: BuyME
Enter float value for col_3: 99.9
Record added through bean

OC4J Command-Line Options and System Properties

You can set both system properties and command-line options on the OC4J command-line before startup. If OC4J is running, you must restart the instance for these to take effect. All system properties are prefaced with a -D. For example, -Dhttp.session.debug. All command-line options are prefaced with a hyphen (-). For example, -help.

As described in "Configuring Server Properties" and shown in Figure A-2, the -D system properties are entered on the Java Options line; the OC4J command-line options are entered on the OC4J Options line.

Figure A-2 EM Console to Modify Server Properties for an OC4J Instance

Text description of sys_err.gif follows.

Text description of the illustration sys_err.gif

Table A-2 OC4J Command-Line Options  
Command-Line Options Description

-install

Installs the server, activates the Admin account, and rewrites text files to match the OS linefeed, and so on.

-quiet

Supress standard output.

-config

Specifies a location for the server.xml file.

-rewriteXML

Rewrites bad XML files (after prompting) as accurately as possible. Warning: If you have corrupt XML files, you may lose data when rewriting if they're badly misformed. Use this command with care.

-out [file]

Specifies a file to route standard output.

-err [file]

Specifies a file to route error output.

-monitorResourceThreads

Enables backup debugging of thread resources. Enable this only if you have problems that relates to threads getting stuck in critical sections of code.

-verbosity

Define an integer between 1 and 10 to set the verbosity level of the message output. Example: -verbosity 10. See Example 3-5 for an example of this option.

-version

Prints the version and exits.

-? -help

Prints the help message.

Table A-3 -D General System Properties for OC4J  
-D Option Description

java.home

Sets the JAVA_HOME environment variable

java.ext.dirs

Sets the external directories to be searched for classes when compiling.

java.io.tmpdir=
<new_tmp_dir>

Default is /tmp/var. To change the temporary directory for the deployment wizard.

The deployment wizard uses 20 MB in swap space of the temp directory for storing information during the deployment process. At completion, the deployment wizard cleans up the temp directory of its additional files. However, if the wizard is interrupted, it may not have the time or opportunity to clean up the temp directory. Thus, you must clean up any additional deployment files from this directory yourself. If you do not, this directory may fill up, which will disable any further deployment. If you receive an Out of Memory error, check for space available in the temp directory.

KeepIIOPCode=
true/false

Default is false. If true, keeps the generated IIOP stub/tie code.

oracle.arraylist.deepCopy=
true/false

If true, then while cloning an array list, a deep copy is performed. If false, a shallow copy is performed for the array list. Default: true

dedicated.rmicontext=
true/false

Default is false. This replaces the deprecated dedicated.connection setting. When two or more clients in the same process retrieve an InitialContext, OC4J returns a cached context. Thus, each client receives the same InitialContext, which is assigned to the process. Server lookup, which results in server load balancing, happens only if the client retrieves its own InitialContext. If you set dedicated.rmicontext=true, then each client receives its own InitialContext instead of a shared context. When each client has its own InitialContext, then the clients can be load balanced.

This parameter is for the client. You can also set this in the JNDI properties.

associateUsingThirdTable=
true/false

For container-managed relationships in entity beans, you can designate if a third database table is used to manage the relationship. Set to false if you do not want a third association table. Default is true. See the "Entity Relationship Mapping" chapter in the Oracle Application Server Containers for J2EE Enterprise JavaBeans Developer's Guide for more information.

DefineColumnType=
true/false

DefineColumnType=true/false. The default is false. Set this to true if you are using an Oracle JDBC driver that is prior to 9.2. For these drivers, setting this variable to true avoids a round-trip when executing a select over the Oracle JDBC driver. This parameter should be set on the OC4J server.

When you change the value of this option and restart OC4J, it is only valid for applications deployed after the change. Any applications deployed before the change are not affected.

When true, the DefineColumnType extension saves a round trip to the database that would otherwise be necessary to describe the table. When the Oracle JDBC driver performs a query, it first uses a round trip to a database to determine the types that it should use for the columns of the result set. Then, when JDBC receives data from the query, it converts the data, as necessary, as it populates the result set. When you specify column types for a query with the DefineColumnType extension set to true, you avoid the first round trip to the Oracle database. The server, which is optimized to do so, performs any necessary type conversions.

oracle.mdb.fastUndeploy=<int>

The oracle.mdb.fastUndeploy system property enables you to shutdown OC4J cleanly when you are running MDBs in a Windows environment or when the backend database is running on a Windows environment. Normally, when you use an MDB, it is blocked in a receive state waiting for incoming messages. However, if you shutdown OC4J while the MDB is in a wait state in a Windows environment, then the OC4J instance cannot be stopped and the applications are not undeployed since the MDB is blocked. However, you can modify the behavior of the MDB in this environment by setting the oracle.mdb.fastUndeploy system property. If you set this property to an integer, then when the MDB is not processing incoming messages and in a wait state, the OC4J container goes out to the database (requiring a database round-trip) and polls to see if the session is shut down. The integer denotes the number of seconds the system waits to poll the database. This can be expensive for performance. If you set this property to 60 (seconds), then every 60 seconds, OC4J is checking the database. If you do not set this property and you try to shutdown OC4J using CTRL-C, the OC4J process will hang for at least 2.5 hours.

oracle.dms.sensors=[none, normal, heavy, all].

You can set the value for Oracle Application Server built-in performance metrics to the following: none (off), normal (medium amount of metrics), heavy (high number of metrics), or all (every possible metric). The default is normal.This parameter should be set on the OC4J server. The previous method for turning on these performance metrics, oracle.dms.gate=true/false, is replaced by the oracle.dms.sensors variable. However, if you still use oracle.dms.gate, then setting this variable to false is equivalent to setting oracle.dms.sensors=none.

Table A-4 -D System Properties for Debugging  
-D Debug System Properties Description

ajp.debug

Default: false. If true, displays the AJP request (headers, mime types, URI etc) and response (status, error messages, and so on).

ajp.io.debug

Default: false. If true, displays the AJP post data, if any, and response data sent to the client.

KeepWrapperCode

Default: false. If true, keeps and debugs the generated wrapper code.

DBEntityHomeDebug

Default: false. If true, displays entity bean home interface debug messages.

DBEntityObjectDebug

Default: false. If true, displays entity bean object debug messages.

DBEntityWrapperDebug

Default: false. If true, displays entity bean pool debug messages.

iiop.runtime.debug

Default: false. If true, outputs IIOP debug messages.

NativeJDBCDebug

Default: false. Native JDBC debug messages.

http.cluster.debug

Default: false. HTTP clustering debug messages.

http.request.debug

Default: false. If true, provides information about each HTTP request to standard output.

http.redirect.debug

Default: false. If true, provides information about each HTTP redirects to standard output.

http.method.trace.allow

Default: false. If true, turns on the trace HTTP method.

http.session.debug

Default: false. If true, provides information about HTTP session events

http.error.debug

Default: false. If true, prints all HTTP errors

http.virtualdirectory.debug

Default:false. If true, print the enforced virtual directory mappings upon startup.

debug.http.contentLength

Default: false. If true, print explicit content-length calls as well as extra sendError information.

ejb.cluster.debug

Default: false. EJB clustering debug messages.

cluster.debug

Default: false. Clustering debug messages.

jms.debug

Default: false. JMS debug messages.

multicast.debug

Default: false. Multicast debug messages.

rmi.debug

Default: false. RMI debug messages.

transaction.debug

Default: false. If true, prints debug messages for JTA events.

rmi.verbose

Default: false. RMI verbose information.

datasource.verbose

Default: false. If true, provides verbose information on creation of data source and connections using data sources and connections released to the pool, and so on,

jdbc.debug

Default: false. If true, provides very verbose information when JDBC calls are made

ws.debug

Default:false. If true, turns on OracleAS Web Services debugging

javax.net.debug=[ssl|all]

If ssl, turns on SSL debugging. If all, turns on SSL debugging with verbose messages.

For more information about debugging properties, see "OC4J Debugging".


Go to previous page Go to next page
Oracle
Copyright © 2002, 2003 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index