The Oracle Containers for J2EE, OC4J

The Oracle Containers for J2EE, OC4J, is a key component of Oracle 9i AS. Oracle 9i AS is a comprehensive package of components for building robust, scaleable Web and multitier applications, but OC4J is, in itself, what is normally referred to as an application server. (OC4J is, in fact, the Orion application server, which Oracle has licensed and re-branded.) It is the only component needed for developing and testing EJB, servlets, and JSPs.

You should not need to download and install the entire Oracle 9i AS suite to obtain OC4J. Not only can OC4J be downloaded and installed individually, but it also comes bundled with the Oracle 9i database and with Oracle JDeveloper. Because the EJB examples in this chapter and the next will use JDeveloper, it is recommended that you use the version of OC4J that comes with JDeveloper.

Installing JDeveloper

After downloading the JDeveloper zip files from Oracle, installation is as simple as unzipping it into the directory of your choice, such as c:\jdev. There is no installation or setup program to run. The OC4J standalone server's home directory will be

 c:\jdev\j2ee\home 

This OC4J directory is separate from the OC4J server embedded in JDeveloper, so we won't have to worry that making changes will cause problems with JDeveloper. It provides us with a separate, standalone test environment to which we can deploy J2EE applications after debugging in the integrated JDeveloper environment.

Installing the OC4J Standalone Server

If you choose not to use JDeveloper, you should instead download the standalone version of OC4J because it is likely to be more recent than the version bundled with Oracle database. It's a relatively small and painless download and installation.

Like JDeveloper, there is no installation program to run; simply unzip it to a directory such as c:\OC4J. The OC4J home directory in this case will be

 c:\OC4J\j2ee\home 

Running OC4J

Before starting OC4J for the first time, you will need to set the administrative password. In the OC4J home directory, verify that there is a file called oc4j.jar and type

 java -jar oc4j.jar -install 

You will be prompted to enter an admin password, ("adminpwd", for example), twice. To start OC4J, enter the following command:

 java -jar oc4j.jar 

You can verify that OC4J is running by opening a browser and entering http://localhost:8888 in the browser's URL address box. (The reason for this URL is that, because we are using the same machine as client and server, we can refer to the server as localhost. By default, the Web server built into OC4J uses port 8888 for HTTP, so as not to conflict with any other Web servers on the machine. Because the standard default HTTP port is 80, we need explicitly to specify the port :8888 as part of our URL.) You should get a Web page welcoming you to Oracle9i AS Containers for J2EE.



Java Oracle Database Development
Java Oracle Database Development
ISBN: 0130462187
EAN: 2147483647
Year: 2002
Pages: 71

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net