Run 2001 J2EETMDeployathon Online!
With Oracle9iAS Containers for J2EETM 1.0.2.2
Step1:Download and Install JavaTM 2 SDK,Standard EditionStep2:Download OC4J Step3: Installand Configure OC4J Step4: Downloadthe Java Pet Store Application Step5: Installand Configure the Java Pet Store Application Step6: Runthe Java Pet Store Application with an Oracle Database NotesSupport
Step 1:Download and InstallJava 2 SDK, Standard Edition
Oracle9iAS Containersfor J2EE1.0.2.2, requires Java 2 SDK, Standard Edition v1.3.0_02 or v1.2.2_07for moredetails, check certificationmatrix . If Java 2, Standard Edition v1.3.0_02 or v1.2.2_07 is notalreadyinstalled on your platform, you need to install it now, from http://java.sun.com/j2se.
Step 2: DownloadOracle9iASContainers for J2EE (OC4J)
Download the latestOC4J from OC4Jdownload page on OTN Step 3: Installand ConfigureOC4J
To install the serverand setthe administrative password: - unzip oc4j.zip
- change to <oc4j-home> directory (<path-to-j2ee>/home)
- java -jar orion.jar -install
- follow the instructions provided by the installation program.
Step 4: Downloadthe JavaPet Store Application
You can download thelatestJava Pet Store Application (version 1.1.2) from the JavaTM Pet Store 1.1.2 Release page Step 5: Installand Configurethe Java Pet Store Application
- Set the environment variable JAVA_HOME to the base directory where you installed the Java 2 SDK. For example, set JAVA_HOME to ~/jdk1.3.0_02 or ~/jdk1.2.2_07
- Configure OC4J DataSource for an Oracle database
- Copy PetStore_data_source into <oc4j-home>/config/data-sources.xml
- or alternatively add PetStore_data_Sources entries to <oc4j-home>/config/data_sources.xml
- Create user estoreuser with password estore
- Grant connect, resource and create session privileges to estoreuser
- Unzip the downloaded application in a directory of your choice (<petstore-home>)
- Configure the PetStore Application to work with an Oracle database
- Change to the directory that contains the expanded PetStore application (<petstore-home>)
- In order to enable Data Access Objects to work against an Oracle database instead of Cloudspace (the default), in <petstore_home>/src/components/customer/src/customer_ejb.xml, replace OrderDAOCS with OrderDAOOracle
- In order to work around a PetStore Application bug which faults PetStore errorpage to throw a "PrintWriter class Not Found Exception", add the following statement to <petstore-home>/src/petstore/src/docroot/errorpage.jsp
<%@ page import ="java.io.*" isErrorPage="true" %>
- Update the Application Server Type
- in <petstore-home>/src/petstore/src/docroot/WEB-INF/web.xml
<env-entry> <description>no description</description>
<env-entry-name>server/ServerType</env-entry-name>
<env-entry-value>Java 2 Enterprise Edition Reference Implementation</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
replace "Java 2 Enterprise Edition Reference Implementation" with "Oracle9iAS Containers for J2EE"
- Deploy the PetStore Application on OC4J Server
- Copy petstore.ear from the <petstore-home>/src/petstore/build/ into <oc4j-home>/applications/
- In <oc4j-home>/config/server.xml, uncomment application entries and add the petstore entry as follows:
<application name="petstore" path="../applications/petstore.ear" />
- In <oc4j-home>/config/default-web-site.xml, uncomment web-app entries and add the petstore entry as follows:
<web-app application="petstore" name="petstore" root="/technology/petstore" />
java -jar orion.jar
or
java -jar orion.jar -config <oc4j-home>/config/server.xml
"Oracle9iAS Containers for J2EE 1.0.2.2 - Up and running" Step 6: Run the Java Pet Store Application
- Open your Web browser.
- Specify the URL: http://localhost:8888/pestore
- Follow the instructions provided by the petstore application to load java Pet Store database tables
Notes
- You do not have to access the Java Pet Store application to check that the Oracle9iAS Containers for J2EE server is running. Simply point your browser to http://hostname:port, where hostname is the host on which the OC4J server is running, and port is the default port number to which the OC4J server is listening. For example, point to: http://localhost:8888
- The instructions for deploying PetStore in step 5 assume local deployment, in order to deploy to a remote OC4J instance use the fololowing command:
java -jar admin.jar ormi://localhost <admin> <admin-pasword> -deploy -file petstore.ear -deploymentName petstore
- To shut down OC4J, gracefully, issue the following command, from <oc4j-home> directory:
% java -jar admin.jar ormi://localhost/ <admin> <admin-password> -shutdown
If it does not shut down the container, force a rapid shut down by passing the force argument, as follows:
% java -jar admin.jar ormi://localhost/ <admin> <admin-password> -shutdown force
For the unlikely situation where none of these work, kill OC4J process(es) with your operating system command
- Note: OC4J release 1.0.2.2 is pre-configured with thin JDBC driver for Oracle8.0, Oracle8i databases; to run OC4J against an Oracle9i database, replace classes12.jar in <oc4j-home>/lib/ with the one shipped with Oracle9i DB
- You can run the PetStore with OC4J using a database other than Oracle8i. If you would like to use another database with OC4J, please check the "Using Merant Drivers" section in Using OC4J
Support
- For questions related to running the Deployathon on Oracle9iAS Containers for J2EE, Please see the Oracle9iAS J2EE.
- The J2EEblueprints interest list is the place to get answers to generic questions about the Deployathon. To join the interest list, send an email to listserv@java.sun.com. Specify subscribe j2eeblueprints-interest yourlastname yourfirstname in the body of the email.
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。