Oracle Application Server Containers for J2EE 10g (9.0.4) -- Frequently Asked Questions

FAQ  Oracle Application Server Logo
 Oracle Application Server Containers for J2EE 10g (9.0.4)
  November 2003

This FAQ addresses frequently asked questions relating to general aspects of Oracle Application Server Containers for J2EE 10g (9.0.4) and is broken into the following sections:


Related FAQs and Sources of Information

  1. Where can I find more information on specific areas?
    Individual FAQs are provided for each major area of OC4J.


    Technology Area URL
    EJB FAQ
    JSP FAQ
    Servlet FAQ
    JMS FAQ
    Web Services FAQ
    Java2 Connectors FAQ
    Java2 Security and JAAS  Coming soon

Release and Certification Information

  1. What is the current production release of Oracle Application Server Containers for J2EE 10g (OC4J).
    The current production release is OC4J 10g (9.0.4).

  2. Is OC4J an officially sanctioned J2EE compatible product?
    Yes. Oracle is a official licensee of J2EE technology from Sun (http://java.sun.com/j2ee/licensees.html). OC4J is officially recognized as a J2EE compatible product. See the J2EE compatibility matrix (See http://java.sun.com/j2ee/compatibility.html) on the Sun Web site for more details.
  3. What are the J2EE compatibility levels of the different OC4J releases?

    Product Version J2EE Compatibility
    OC4J 9.0.4 J2EE 1.3
    OC4J 9.0.3 J2EE 1.3
    OC4J 9.0.2 J2EE 1.2
    OC4J 1.0.2.x J2EE 1.2
  4. What versions of the J2SE can I use with OC4J?
    All official certification information for Oracle products is available on the Oracle support Web site, http://metalink.oracle.com.

    Product Version J2SE Certification
    OC4J 9.0.4 J2SE 1.4.x, J2SE 1.3.x
    OC4J 9.0.3 J2SE 1.4.x, J2SE 1.3.x
    OC4J 9.0.2 J2SE 1.3.x, J2SE 1.2.x
    OC4J 1.0.2.x J2SE 1.3.1, J2SE 1.2.x
  5. What is OC4J standalone?
    OC4J standalone is a distribution of Oracle Application Server product that contains just the J2EE and Web Services components. OC4J standalone is much smaller than the full Oracle Application Server product and is downloaded as a single zip file. It is executed as a single Java process.

    OC4J standalone is J2EE 1.3 compatible and is able to be used in both development and small scale production environments. OC4J standalone provides its own inbuilt HTTP/S listener to allow clients to execute Web applications that it has deployed. Application deployment and server configuration of OC4J standalone is performed by the manual editing of a simple set of XML files.

    For large scale enterprise deployments, the Oracle Application Server product is likely to be more suitable with its comprehensive feature set including Oracle HTTP Server, process monitoring and management capabilities, and its configuration and management console.
  6. Are there any significant differences between OC4J standalone and the OC4J used inside of Oracle Application Server?
    In terms of code, the set of bits that make up OC4J standalone and the OC4J inside of Oracle Application Server are practically identical. If you develop and deploy an application to OC4J standalone, then it will work when deployed to Oracle Application Server.

    The most predominant difference between the two environments is the configuration. The Oracle Application Server OC4J is configured to run within the Oracle Application Server environment. This means that it is configured with additional class libraries to support the added features of Oracle Application Server such as Portal, it listens for connections on a different range of ports (dynamically allocated by Oracle Application Server), it logs outputs to different directories and files, and it's default Web listener is configured to talk AJP with mod_oc4j rather than HTTP with a direct browser client.

    Another difference is the way in which OC4J is administered and managed. Within an Oracle Application Server environment, OC4J is configured as part of the entire application server technology stack, using Oracle Enterprise Manager Application Server Control or it's command line equivalent tool, dcmctl. Direct manipulation of the XML configuration files is not a preferred option, although it can be done. Application deployment is also performed using Oracle Enterprise Manager Application Server control or the dcmctl command line utility. Oracle Application Server OC4J processes are started and stopped using the same management console, and can be configured to be automatically managed as part of an Oracle Application Server instance.

    In contrast, the management, deployment and administration tasks for OC4J standalone are all largely manual through the direct editing of its XML configuration files. A command line utility does exist for OC4J standalone, admin.jar, which enables some tasks to be performed using a set of commands, but these are not the same as the commands used in the Oracle Application Server environment.

    For more information on configuring Oracle Application Server OC4J and it's command line utility dcmctl, please see the OC4J Standalone User's Guide.

    For more information on configuring OC4J standalone and it's command line utility admin.jar, please see the OC4J Standalone User's Guide.
  7. Where can I see the documentation for OC4J?
    Documentation for all Oracle products is available from the Oracle Technology Network (OTN) -- http://otn.oracle.com/documentation/content.html. The specific documentation set for OC4J is available at http://otn.oracle.com/documentation/appserver10g.html. A User's Guide for OC4J standalone is supplied with the OC4J standalone distribution. The Readme.txt file in the root directory of the OC4J standalone distribution provides a set of basic information on how to install and use the product.
  8. Where can I see a list of all of the capabilities of OC4J?
    The best place to get technical information about OC4J is on the OC4J home page on OTN -- http://otn.oracle.com/tech/java/oc4j. The OC4J Feature Overview lists the features available in the OC4J 10g (9.0.4) release.
  9. Where can I get more information about OC4J?
    The best place to get technical information about OC4J is on the OC4J home page on OTN -- http://otn.oracle.com/tech/java/oc4j.

Top of Page


Using OC4J

  1. What do I need to do to install OC4J standalone?
    To instal OC4J standalone, unzip the oc4j_extended.zip file using the archive utility of your choice. The jar utility in your J2SE installation can also be used.

    This will create the following directory structure:

    <install-dir>
    /bin
    /j2ee
    /javacache
    /javavm
    /jdbc
    /jdk
    /jlib
    /lib
    /rdbms
    /soap
    /sqlj
    /webservices

    Where <install-dir> is the directory in which you unzipped the oc4j_extended.zip file.

    To complete the installation of OC4J change to the <install-dir>j2ee/home directory, and issue the following command:

    > cd <install-dir>/j2ee/home
    > java -jar oc4j.jar -install

    The <install-dir>/j2ee/home directory is referred to as <J2EE_HOME>.

    The installation prompts you to enter and verify an administration password, which is used for the administration console command-line tool. The administration username defaults to "admin". Enter any administration password.

    These instructions are contained in the /Readme.txt file within the OC4J standalone distribution.

  2. How do I start OC4J standalone?
    Start OC4J server by changing to the J2EE_HOME directory and issuing one of the following commands:

    a) To start OC4J using the default configuration files (recommended), which are located in the j2ee/home/config directory.

    > cd <J2EE_HOME>
    > java -jar oc4j.jar

    b) To start OC4J using a custom server.xml file located in /mypath.

    > cd <J2EE_HOME>
    > java -jar oc4j.jar -config /mypath/server.xml

    The server outputs an initialization string with the version number when it is ready to accept requests, for example:

    Oracle Application Server Containers for J2EE 10g (9.0.4.0.0) initialized
  3. How do I stop OC4J standalone?
    You can stop OC4J by pressing ^c (Ctrl+c) in the window where the process was started, or by using the shutdown command in the admin.jar command-line utility, or by using the process termination command (for example "kill" on UNIX/Linux) for your operating system.

  4. How do I use the admin.jar utility to shutdown OC4J standalone?
    To shut down OC4J using admin.jar execute the following command:

    >cd <J2EE_HOME>
    > java -jar admin.jar ormi://<oc4j_host>:<oc4j_ormi_port> <admin>
      <admin-password> -shutdown

    This command provides a graceful shutdown of the container. If it does not shut down the container, you can force a rapid shutdown by passing the -force argument, as follows:

  5. > java -jar admin.jar ormi://<oc4j_host>:<oc4j_ormi_port> <admin>
      <admin-password> -shutdown force

See the OC4J Standalone User's Guide for more information.

  1. Can I install and run OC4J as a service on Windows 2000/XP?
    There is no supported way to install OC4J as a direct service on Windows platforms. We recommend that if you have a requirement for 24x7 availability, you install and use one of the Oracle Application Server installation types. Oracle Application Server provides an automated process management capability which is installed and executed as a service on Windows platforms. The Oracle Application Server process manager can be configured to start OC4J instances, therefore providing you with an automated start/restart mechanism for OC4J on Windows platforms.

    See the Concepts Guide of the Oracle Application Server documentation set for more information.

  2. What is the default HTTP port of OC4J?
    The default HTTP port of OC4J standalone is 8888. This is specified in the configuration file <J2EE_HOME>/config/http-web-site.xml. If you have installed one of the Oracle Application Server distributions instead of OC4J standalone, then you must access Web applications deployed on OC4J via Oracle HTTP Server. The default port of Oracle HTTP Server is 7777.

Top of Page


Configuring OC4J

  1. Is there a GUI management console for OC4J standalone?
    Not in this release. All configuration and deployment operations with OC4J standalone are performed by directly modifying it's configuration files. We will be providing a Web based management console that makes use of the latest JMX specifications to perform both configuration and deployment tasks in a forthcoming release.

  2. Can I use HTTPS with the OC4J HTTP listener?
    Yes. The OC4J HTTP listener supports HTTPS and can be configured to operate in this fashion.

    Please see the relevant OC4J User's Guides (standalone or Oracle Application Server) for more information.


  3. How do I change the HTTP port used by the OC4J HTTP listener?
    The port used by the OC4J HTTP listener is defined in the configuration file <J2EE_HOME>/config/http-web-site.xml file using the port attribute of the web-site tag.

    <web-site port="8888" display-name="Oracle Application Server Containers for J2EE HTTP Web Site">

    You can use a different port number by changing the value.

  4. How do I get a connection to a database using OC4J?
    OC4J uses data sources to define connections to databases. When OC4J starts, it creates DataSource objects based on it's configuration information. These DataSource objects act as connection factories, and allow applications to obtain a connection without knowing the physical details of the database being used.

    Data sources are defined by default in the file J2EE_HOME/config/data-sources.xml. When using OC4J standalone you can manually add entries to this file to represent the databases you need to connect to. When using Oracle Application Server, you use the Oracle Enterprise Manager console to define data sources.

    A data source definition contains all of the information the data source needs to connect to the desired database. A typical example looks like:
  5. <data-source
      class="com.evermind.sql.DriverManagerDataSource"
      name="OracleDS"
      location="jdbc/OracleCoreDS"
      xa-location="jdbc/xa/OracleXADS"
      ejb-location="jdbc/OracleDS"
      connection-driver="oracle.jdbc.driver.OracleDriver"
      username="scott"
      password="tiger"
      url="jdbc:oracle:thin:@localhost:1521:oracle"
      inactivity-timeout="120"
      stmt-cache-size="100"
    />

See the J2EE Services Guide of the OC4J documentation set for more information.

  1. What if I don't want to put the database user password in cleartext?
    OC4J 9.0.4 allows you to specify passwords used in its various configuration files in a secure manner through the use of password indirection. Password indirection allows you to specify the name of a user in a secure repository, from which OC4J will extract the password to use. This enables passwords to be maintained in a centralized location and allows the choice of using the local XML user store or the use of the Oracle Internet Directory.

    See J2EE Services Guide of the OC4J documentation set for more information.
  2. Can I use databases other than Oracle with OC4J? Is this supported?
    Yes. In fact, Oracle supplies a set of supported JDBC drivers that connect to databases from IBM, Sybase, and Microsoft. Using JDBC drivers other than those in the Oracle supplied library is not supported. To establish a connection to a non Oracle database, you configure a datasource for OC4J which defines the JDBC driver to use and provides other required pieces of information such as the JDBC URL, connection names, etc.

    See the Data Sources chapter in the J2EE Services Guide of the OC4J documentation set for more information.

Top of Page


Packaging and Deploying Applications

  1. Can I deploy just an Web application as a WAR file?
    Yes. If you wish to deploy only a Web module then you can utilize the default application OC4J is configured with. This is a two step task:

    First, tell the container about the WAR file to be deployed. Open the <J2EE_HOME>/config/application.xml file in an editor. Add a new <web-module> tag and specify the attributes for your WAR file.
  2. <web-module id="HRWebModule" path="<PATH-TO-WAR-FILE>"/>

Secondly, tell the OC4J HTTP server about the new WAR file and provide a URL to access it. Open the <J2EE_HOME>/config/http-web-site.xml file in an editor. Add a new <web-app> tag and specify the attributes for your new Web module. It's important to note that the application attribute must specified as "default" since you have deployed your Web module to the default application. The name attribute should match the ID attribute you specified for the Web module.

    <web-app application="default" name="HRWebModule" root="/hrweb" />

The WAR file will now be deployed by OC4J and accessible using a URL of /hrweb.

If you are using Oracle Application Server instead of OC4J standalone, then you can deploy WAR modules directly from the management console.

  1. Where can I put shared class libraries so they are accessible to all my deployed applications?
    OC4J is configured by default with a shared directory. The directory is <J2EE_HOME>/applib. Any class libraries that are placed in this directory will be accessible to applications deployed on OC4J.

    The shared directory is specified using the <library> tag in the default application configuration file <J2EE_HOME>/config/application.xml.
  2. <orion-application autocreate-tables="true" default-data-source="jdbc/OracleDS">

    <web-module id="defaultWebApp" path="../../home/default-web-app"/>
    <web-module id="dms0" path="../../home/applications/dms0.war"/>
    <web-module id="dms" path="../../home/applications/dms.war"/>
    <persistence path="../persistence"/>

    <!-- Path to the libraries that are installed on this server.
         These will accesible for the servlets, EJBs etc -->
    <library path="../applib"/>

    ...

    </orion-application>

For more information about class Loading and packaging issues, see the technical note on OTN -- http://otn.oracle.com/tech/java/oc4j/pdf/ClassLoadingInOC4J_WP.pdf.

  1. How can I use a 3rd party XML parser such as xerces with OC4J?
    OC4J is preconfigured to use the Oracle XML parser. The Oracle XML parser is fully JAXP 1.1 compatible and will serve the needs of applications which require JAXP functionality. This approach does not require the download, installation, and configuration of additional XML parsers.

    The Oracle XML parser (xmlparserv2.jar) is configured to load as a system level library of OC4J through it's inclusion as an entry in the Class-Path entry of the oc4j.jar Manifest.mf file. This results in the Oracle XML parser being used for all common deployment and packaging situations. You are not permitted to modify the Manifest.mf file of oc4j.jar.

    It must be noted that configuring OC4J to run with any additional XML parser or JDBC library is not a supported configuration. We do know customers who have managed to successfully replace the system level XML parser and the Oracle JDBC drivers that ship with the product, but we do not support this type of configuration due to the possibility of unexpected system behavior and system errors that might occur from replacing the tested and certified libraries.

    If you absolutely must use an additional XML parser such as xerces, then you have to start OC4J such that the xerces.jar file is loaded at a level above the OC4J system classpath. This can be accomplished using the -Xbootclasspath flag of the JRE.

    java -Xbootclasspath/a:d:\xerces\xerces.jar -jar oc4j.jar

    Once again, please note that configuring in such a manner is not a supported configuration.
  2. Can I deploy a pre-configured data sources file along with my application?
    Yes. You may package both security and datasource configuration files with your application archive (EAR) file. When the application is deployed, the files will be used by OC4J to establish connections or validate user credentials. This is a standard packaging mechanism employed by Oracle JDeveloper when it deploys applications.

    To achieve this, provide the files you want to accompany the deployment in the same directory as the J2EE application.xml file. In addition, provide an orion-application.xml file which contains references to the files you wish to deploy along with your application.

    Let's say you wish to include a data-sources.xml file with your application. The data-sources.xml will contain configuration information about which database this application must connect to.

    The EAR file should look like the following:
  3. <EAR-FILE>

    /META-INF

    application.xml
    orion-application.xml
    data-sources.xml

    webmodule.war
    ejbmodule.jar

The orion-application.xml contains an entry to indicate that the local data-sources.xml file should be used.

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

At deployment time, OC4J will use the contents of the orion-application.xml you provided as a template for the final version it generates. It will also copy the data-sources.xml file you specified from the EAR file into its deployment directory and use it as the data source configuration file for the application.

Top of Page


Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.

Worldwide Inquiries:
+1.650.506.7000
Fax +1.650.506.7200
http://www.oracle.com/

Copyright © Oracle Corporation 2003
All Rights Reserved

This document is provided for informational purposes only,
and the information herein is subject to change
without notice.  Please report any errors herein to
Oracle Corporation.  Oracle Corporation does not provide
any warranties covering and specifically disclaims any
liability in connection with this document.

Oracle is a registered trademark of Oracle Corporation.

All other company and product names mentioned are used
for identification purposes only and may be trademarks of
their respective owners.
 

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy