How to Deploy a BC4J Application to the Oracle9iAS J2EE Container

11th July 2001

This document tells you how to:

  • Use the BC4J runtime installer to install the BC4J runtime libraries and the Oracle JSP compiler in OC4J
  • Run the online orders sample application to test your installation
  • Deploy your own BC4J application and JSP pages to OC4J as a web module
  • Start OC4J and test your application

The reason for installing the OJSP compiler is to work around some bugs in the first release of OC4J that affect JSPs with data tags.

This document assumes you have installed Oracle9iAS v1.0.2.2 J2EE Container (OC4J) and Oracle JDeveloper version 3.2.3. Both of these products are available for download from the OTN download page.

What does the BC4J runtime installer do?

  1. Installs all Business Components for Java (BC4J) runtime libraries (version 3.2.3.999) to an Oracle9iAS v1.0.2.2 J2EE Container (OC4J)
  2. Installs the Oracle JSP compiler (OJSP) version 1.1.3.1
  3. Installs other libraries that BC4J applications need, including Oracle JDBC
  4. Installs the Online Orders sample application to OC4J
  5. Provides a .bat file that starts up OC4J with the correct classpath.
  6. When Deinstall is selected, deinstalls all of the components it has installed.

How to run the installer

  1. Download the installer (15,742 kb)
  2. Unzip bc4j-ojsp to a temporary location. All files will be copied to a folder named Disk1.
  3. Go to the Disk1 folder and double-click setup.exe to start the Oracle Universal Installer.
  4. In the first screen of the installer (Welcome), click Next
  5. In the second screen (File Locations) click Next
  6. In the third screen (Please input JDK home directory) click Browse and select the location of your JDK home, for example: d:\jdk1.3. Click Next. Note: Your JDK must be version 1.2.2 or greater.
  7. In the fourth screen (Please input OC4J home) click Browse and select the location of your OC4J home, for example d:\j2ee\home . Click Next, then click Next again.
  8. In the Summary screen, click Install.
  9. When installation has completed, click Exit.

How to run the Online Orders sample application on OC4J

  1. Start OC4J (see the instructions near the end of this document)
  2. If you already have the online orders sample schema installed in an Oracle database:
    • Edit OC4J_HOME\classes\connections.properties, and find this parameter setting in the entry for CM_Connection1.

      URL\=jdbc\\\:oracle\\\:thin\\\:@localhost\\\:1521\\\:ORCL

    • Replace localhost, 1521, and ORCL with the correct host, JDBC port, and SID for your database connection.
  3. If you don't have the online orders sample schema installed in a database:
    • In a browser, go to http://localhost:8888/bc4j.html or http://127.0.0.1:8888/bc4j.html
    • Click the Sample Application Setup
    • Enter values for the user, password, and database URL, for example: system/manager and jdbc:oracle:thin:@localhost:1521:ORCL
    • Click Setup.
  4. Run the Online Orders sample. In a browser, go to
  5. http://localhost:8888/onlineorders/main.jsp or http://127.0.0.1:8888/onlineorders/main.jsp

How to deploy a BC4J application to OC4J as a web module

This section gives the steps for deploying a BC4J application to OC4J and enabling a JSP client to access this application in a web module configuration. The JSP client can use data tags or data web beans to access the business components.

Note: OC4J_HOME represents the location of your OC4J installation (for example, d:\j2ee\home), and JDEV_HOME represents the location of your JDeveloper installation (for example, d:\jdev323).

  1. Develop your BC4J application and your JSP client in JDeveloper 3.2.3.
  2. Deploy your BC4J application to OC4J as a .jar file:
    • Select your BC4J project in the navigator
    • In the main menu, select Project | Deploy | New Deployment Profile.
    • In Step 1 of the Deployment Profile Wizard, select Deploy as a simple archive file. Click Next.
    • In Step 2 of the wizard, click Next.
    • In Step 3 of the wizard, click Browse.
    • In the file dialog, navigate to OC4J_HOME\lib. Type a name for your jar file (or accept the default) and press Enter. Click Finish.
    • In the message window ("Deploy now...?") click Yes.
  3. Copy the folder containing your .jsp files from JDEV_HOME\myhtml to OC4J_HOME\default-web-app
  4. Web bean JSPs only: Copy your JSP application's .properties file from JDEV_HOME\myclasses to OC4J_HOME\classes
  5. Add your connections to OC4J_HOME\classes\connections.properties:
    • Open your connections.properties file (JDEV_HOME\myclasses\connections.properties) in a text editor and select the numbered connections (line 3 onwards).
    • Open OC4J_HOME\classes\connections.properties and paste your connections at the end of the file.
    • In OC4J_HOME\classes\connections.properties, change the name of each connection so that they are sequentially numbered (CM_Connection1, CM_Connection2, and so on).
    • Change the value of CM_NumConnections to the total number of connections in the file.
    • Save your changes.

How to start OC4J and test your application

  1. Start OC4J. In a command window, go to OC4J_HOME and type:

    bc4j-oc4j

    Note: If you are using OJVM (Oracle JVM), before you start OC4J you should follow the instructions in bc4j-oc4j.bat for setting the -classic option.

  2. Start the JSP application by entering the following URL, where jspdir is the directory under default-web-app where your JSP is located, and jspname.jsp is the name of your JSP:

    http://hostname.domain.com:8888/htmldir/jspname.jsp

How to deinstall BC4J runtime and OJSP

  1. From your Start menu, select Programs | Oracle Installation Products | Universal Installer.
  2. In the first screen of the installer (Welcome), click Deinstall Products.
  3. In the Inventory window, navigate to BC4J Runtime and OJSP for OC4J 3.2.3.1.1. Select this item and click Remove.
  4. In the confirmation window, click Yes.
  5. When deinstall has completed, close the Inventory window and exit from the installer.

To reinstall the components, run the Universal Installer from your Start menu.

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