Copying BC4J Runtime Libraries to OC4J for Web Application Deployment

If your OC4J server is not using the embedded OC4J server which is included with JDeveloper or if your OC4J server does not seem to have the Business Components for Java framework installed, you can set up the standalone OC4J server with the BC4J runtime libraries. You can do this either automatically with a script or manually by copying files.

Automatic Installation

JDeveloper provides an automated script that configures a standalone OC4J to work with BC4J. The bc4j2oc4j.bat script is available in:

<jdev_install>/Bc4j/bin

There are two bc4j2oc4j scripts, one is a UNIX shell script and one is a DOS batch script. JDeveloper works on Solaris. You should unzip OC4J into a directory outside of the Oracle Home. See the How To document at the following location for details on using this script:

http://otn.oracle.com/products/jdev/htdocs/config_oc4j_for_bc4j.html

Manual Installation

To deploy BC4J web applications to a standalone OC4J server not running JDeveloper:

You require a complete JDeveloper installation which includes the BC4J runtime libraries and which you will copy to the target OC4J server. OC4J is installed in the <jdev_install>/j2ee/home directory or the "OC4J Home".

  1. From an existing JDeveloper installation, copy the entire <jdev_install> directory tree to your target OC4J server machine.
    Note: If you do not plan to use the JDeveloper IDE on your server machine, you can omit the <jdev_install>/jdev directory and its subdirectories.
  2. Copy the application.xml file from the JDeveloper <jdev_install>/j2ee/home/config directory to the <OC4J_HOME>/j2ee/home/config directory. This file contains a listing of the JDeveloper runtime files and sets the classpath for all of these files.
  3. In JDeveloper, make sure that you created an OC4J server connection that successfully connects to your target (external) OC4J server. For example, this connection can be named "MyExternalOC4J."
  4. In JDeveloper, select bc4j.ear in the Navigator (below WAR_dep_profile_icon <projectname_jpr_War.deploy>) and deploy it to the target OC4J server by choosing Deploy to <target_OC4J_server> from the context menu.
    Note: The bc4j.ear contains support for the BC4J web application images and cascading style sheets and UIX libraries. You can also find the bc4j.ear file in <jdev_install>/Bc4j/redist directory.
  5. Add the BC4J web dependencies to your web application's WAR file:
    1. Select the <MyProject_jar_War>.deploy deployment profile in the Navigator and choose Settings from the context menu.
    2. Click WEB-INF/lib to display a list of libraries that are in your project's current active configuration.
    3. Click the following groups of dependencies to add them to your WAR file:
      1. BC4J Runtime
      2. Oracle interMedia
      3. Connection Manager
      4. BC4J Oracle Domains
    4. (Optional) Click Profile Dependencies if the deployment profile depends on J2EE modules from another deployment profile. Select the checkbox next to the <name_of_deployment_profile>.deploy you want included with the deployment.
    5. (Optional) If you want to pass command line parameters to any of the supported target connection types, click the Standalone OC4J node.
    6. Click OK when you are done.
  6. Select the WAR_dep_profile_icon <myappwar>.deploy deployment profile and choose Deploy to <target_OC4J_server> from the context menu.
  7. If necessary, start the OC4J application server with the following command:
    % Java -jar oc4j.jar <options>
  8. Point your browser at your external OC4J server and run your application.

Important: Make sure that you have the tools.jar in the OC4J classpath. This file is located in <jdev_install>/jdk/lib. This file must match the version of the JDK being used to run OC4J. If it does not, you may have problems running applications in OC4J standalone mode.


Related topics

Editing Deployment Descriptors