打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Petstore Demo

Run 2001 J2EETMDeployathon Online!
With Oracle9iAS Containers for J2EETM 1.0.2.2 

Step1:Download and Install JavaTM 2 SDK,Standard Edition
Step2: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
Notes
Support

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"
  • Rebuild the Application to integrate configuration changes

  • In order to remove J2EE R.I. dependencies in <petstore-home>/src/petstore/src/build.xml
     

    • J2EE_HOME is not used, but checked in build.sh, we suggest to set it to any valid directory path
    • Replace the content of <petstore-home>/src/petstore/src/build.xml with  oc4j_build.xml 
    • Copy manifest.mf into <petstore-home>/src/petstore/src/
    • Change to  <petstore-home>/src/petstore/src/
    • Invoke build.sh (Unix) or build.bat (Windows)
  • 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" />
       
  • Start the server
    • To start the server:
              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.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Linux 宝库 - 图解JDeveloper10g快速开发会话EJB(上)
如何以 sysdba 身份登陆 iSQL*Plus ?
uPortal的安装配置
Apache Sentry安装及简单使用
MySQL 01:数据库简介与安装配置
RMAN: 从NBU备份磁带库恢复到异机案例
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服