|
Steps to Deploy JHeadstart Tutorial Application
Several users who have completed the Building J2EE Applications with Oracle JHeadstart for ADF tutorial have asked what steps would be necessary to deploy the application to an external application server. I include the steps necessary below:
- Start an external OC4J server
- The simplest one to use is the OC4J server that ships with JDeveloper 10.1.2, but instead of using it embedded inside JDeveloper, you can start it up as an external server by running the <JDEV_HOME>/jdev/bin/start_oc4j.bat script that comes with JDeveloper 10.1.2.
- After the console messages stop, the server is setup and running. To test that it's working correctly, point your browser at http://localhost:8888/ and you should see a welcome page.
- Define an application server connection named "localoc4j"
- Select View | Connection Navigator to see the connection navigator.
- Select the Application Server node in the tree and choose the New Application Server Connection... from the right mouse menu.
- In Step 1 of the wizard, enter a Connection Name of localoc4j and keep the default Connection Type of Standalone OC4J
- In Step 2 of the wizard, keep the default admin username, specify welcome for the default password, and click the Deploy Password checkbox. The password is encrypted so it's ok to do this.
- In Step 3 of the wizard, keep all the defaults
- In Step 4 of the wizard, click the (Test Connection) button to test the connection
- Click (Finish) the close wizard and create the application server connection definition.
- Create a WAR File Deployment Profile in the ViewController project
- Select your ViewController project and choose New... from the right-mouse menu
- In the New Gallery, select the General > Deployment Profiles category, and select the WAR File deployment profile, then click (OK)
- In the Create Deployment Profile -- WAR File dialog, enter a Deployment Profile Name of MyDemo, then click (OK)
- When the WAR Deployment Profile Properties dialog appears, just click (OK) to accept all the default settings.
- In the Application Navigator, notice that your ViewController project now as a new MyDemo.deploy file in its Resources folder.
- Deploy the application to an application server connection
- Select the MyDemo.deploy deployment profile in the Application Navigator, and choose Deploy to > localoc4j from the right might menu.
JDeveloper 10g will compiler the application, create the WAR file, include it in an EAR file, and then invoke the OC4J administration tool to deploy your application. A Deployment tab will open in the Log Window, and Once the Deployment and you will see log output similar to this: ---- Deployment started. ---- May 20, 2005 3:00:24 PM Target platform is Standalone OC4J (localoc4j). Wrote WAR file to C:\MyDemo\ViewController\deploy\MyDemo.war Wrote EAR file to C:\MyDemo\ViewController\deploy\MyDemo.ear Invoking OC4J admin tool... C:\jdev1012\jdk\jre\bin\javaw.exe -jar C:\jdev1012\j2ee\home\admin.jar ormi://smuench-xp/ admin **** -deploy -file C:\MyDemo\ViewController\deployMyDemo.ear -deploymentName MyDemo Notification ==> Application Deployer for MyDemo STARTS [ 2005-05-20T15:00:44.655CEST ] Notification ==> Undeploy previous deployment Notification ==> Copy the archive to C:\jdev1012\j2ee\home\applications\MyDemo.ear Notification ==> Unpack MyDemo.ear begins... Notification ==> Unpack MyDemo.ear ends... Notification ==> Initialize MyDemo.ear begins... Notification ==> Initialize MyDemo.ear ends... Notification ==> Initialize MyDemo begins... Notification ==> Initialize MyDemo ends... Notification ==> Application Deployer for MyDemo COMPLETES [ 2005-05-20T15:01:43.589CEST ] Exit status of OC4J admin tool (-deploy): 0 C:\jdev\1012_rel\jdk\jre\bin\javaw.exe -jar C:\jdev1012\j2ee\home\admin.jar ormi://smuench-xp/ admin **** -bindWebApp MyDemo MyDemo http-web-site /MyDemo Exit status of OC4J admin tool (-bindWebApp): 0 Use the following context root(s) to test your web application(s): http://smuench-xp:8888/MyDemo Elapsed time for deployment: 1 minute, 32 seconds ---- Deployment finished. ---- May 20, 2005 3:01:56 PM
After this, you can point your browser at http://localhost:8888/MyDemo and try the application on your external OC4J application server.
NOTE: If you are trying to deploy the demo to another J2EE application server, review the Installing the ADF Runtime Libraries on a Server topic in the online documentation, and then deploying the J2EE WAR file can be done using the deployment tool of the target server (or automatically if it's one of the server's for which JDeveloper provides built-in deployment support for).
|