0% found this document useful (0 votes)
96 views

Deploying J2EE and ADF Applications: Purpose

This tutorial shows how to deploy J2EE and ADF applications from JDeveloper to an Oracle Application Server 10g. The steps are: 1. Create an application server connection to the Oracle 10g Application Server. 2. Deploy the J2EE application by creating a JAR file for the EJB component, a WAR file for the JSP view, and an EAR file to package them. 3. Deploy the ADF application by creating a WAR file for the ADF view and deploying it to the application server. Both applications can then be tested using a web browser.

Uploaded by

Sky
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views

Deploying J2EE and ADF Applications: Purpose

This tutorial shows how to deploy J2EE and ADF applications from JDeveloper to an Oracle Application Server 10g. The steps are: 1. Create an application server connection to the Oracle 10g Application Server. 2. Deploy the J2EE application by creating a JAR file for the EJB component, a WAR file for the JSP view, and an EAR file to package them. 3. Deploy the ADF application by creating a WAR file for the ADF view and deploying it to the application server. Both applications can then be tested using a web browser.

Uploaded by

Sky
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

lesson_Deployment

Deploying J2EE and ADF Applications

Purpose

This tutorial shows you how to use JDeveloper to archive and deploy J2EE and ADF applications to an Oracle 10g Application Server.

Deployment is the process of packaging the files that make up an application as an archive file, and transferring the archive to the server where the application
will run. This tutorial shows you how to use JDeveloper to deploy either J2EE or ADF applications to application servers through application server
connections. The basic steps are:

1. Create the application as a JDeveloper project.


2. Package the project components into a deployment profile and specify deployment resources.
3. Create an application server connection to the Oracle Application Server.
4. Deploy the packaged application to the Oracle Application Server.

Topics
This lesson discusses the following:

Overview
Prerequisites
Step 1 - Compile and Run the Application from JDeveloper
Step 2 - Create a Connection to the Application Server
Step 3 - Deploy a J2EE Application
Step 4 - Deploy an ADF Application
Summary

Time to complete

1 hour

Viewing Screenshots

Move your mouse over this icon to show all screenshots. You can also move your mouse over each individual icon to see only the screenshot
associated with it.

Overview

This tutorial shows you how to use JDeveloper to package and deploy the model and view components of both J2EE and ADF applications.

The J2EE application is composed of an EJB as the model component and a JSP as the view component. The model is deployed to an
EJB JAR file with the JSP deployed to a WAR file. Once each component has been deployed to the appropriate archive, both are included
in an EAR file, then deployed to the Oracle Application Server 10g .

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (1 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

The ADF application view component is archived to a WAR file and then deployed to the Oracle Application Server 10g. In both the J2EE
and ADF deployments, the application can then be accessed using a browser.

Back to Topic List

Scenario
To complete this OBE, you must download and install two JDeveloper workspaces. Each contains a sample application for you to deploy. These applications
access the Common Schema Human Resources database objects. It is very important to create and name the JDeveloper Database Connections according
to the specifications found in the second step of the prerequisites.

Prerequisites
Back to Topic List
In order for this lesson to work successfully, you need to have performed the following:

Install Oracle JDeveloper10g.


1.
Install the Oracle Application Server 10g. You will need the administrator Username and Password to start and stop it.
2.
Install the sample schema and create a connection to the HR or HR8 schema to use in this lesson. See Installing the Sample Schemas and
3.
Establishing a Database Connection tutorial. Ensure the name of the connection is tutorial_jdbc_connection.
Download the deploySamples.zip file to your machine. It contains the sample JDeveloper workspaces for use in this OBE.
4.

Step 1- Compile and Run the Applications from JDeveloper


Back to Topic List

In this step, you will load two application workspaces in JDeveloper and test the applications using the embedded OC4J server. One workspace contains a
J2EE application with a JSP as the view and an EJB defining the business rules. The second workspace contains an ADF application.

Download and unzip the deploySamples.zip file onto your machine in the <JDEVELOPER_HOME>\jdev\mywork\ directory.
1.
You should have two directories: deployment_j2ee and deployment_adf . The deployment_j2ee directory contains a J2EE application and the
deployment_adf contains an ADF application.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (2 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Invoke JDeveloper and independently open each of the two workspaces. Select Open from the File menu, and navigate to the
2.
<JDEVELOPER_HOME>\jdev\mywork\deployment_j2ee directory. Select the J2EEApplication.jws file and click OK
to load the J2EE workspace. Repeat the Open operation and select the ADFApplication.jws file in the <JDEVELOPER_HOME>
\jdev\mywork\deployment_adf directory.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (3 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Compile the J2EE application by selecting the J2EEApplication workspace in the Application Navigator and selecting the Make option
3.
from the context menu.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (4 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Run the J2EE application. Expand the View node and select the login. From the context menu, select Run.
4.

When the application is invoked, login using 100 as the Employee Id and King as the Employee Name.
5.

Move
your
mouse
over
this
icon
to
see
the
image

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (5 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Three employees belonging to the same department as King are displayed.


6.

Compile the ADF application by selecting the ADFApplication workspace in the Application Navigator and selecting the Make option from
7.
the context menu.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (6 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Run the ADF application. Expand the ViewController and Web Content nodes and select Login.jsp. From the context menu, select
8.
Run.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (7 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

When the application is invoked, login using 100 as the Employee Id and King as the Employee Name.
9.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (8 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Three employees belonging to the Executive department are displayed.


10.

Step 2- Create a Connection to the Application Server


Back to Topic List

JDeveloper supports deploying your applications to a variety of production application servers, via application sever connections. You must create a
connection to deploy applications directly to Oracle Application Server 10g from JDeveloper.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (9 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Click the Connections tab in the Navigator. Right-click Application Server and select New Application Server Connection.
1.

In the Type pane, name the connection OracleAS10g and specify Oracle Application Server 10g as the connection type. Click Next.
2.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (10 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Provide the password in the Authorization pane for the ias_admin user, for example, welcome1, and click Next.
3.

In the Connection pane, accept the default host name and port and specify the ORACLE_HOME directory for the Oracle Application Server
4.
10g install, for example, D:\Oracle\OraAS10g, and click Next.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (11 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Click Next and accept the default values for the EJB Client Connection.
5.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (12 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Click Next and in the Test pane, click the Test Connection button. When the status message indicates success, click Finish.
6.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (13 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Step 3- Deploy a J2EE Application

In this step you create an archive for the J2EE components, deploy it to the Oracle Application Server 10g, and test it from a browser.

Back to Topic List

Create and Deploy a JAR file for the J2EE EJB Model Project
Create and Deploy a WAR file for the J2EE View Project
Create and Deploy an EAR file for the Complete J2EE Application
Test the J2EE Application Deployment

Create and Deploy a JAR file for the J2EE EJB Model Project
Back to List

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (14 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

With the J2EEApplication node expanded in the Application Navigator, right-click Model node, and select New.
1.

2. From the âœDeployment Profilesâ• category, select âœEJB JAR Fileâ• and click OK.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (15 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Accept the default Deployment Profile Name (ejb1). Click OK.


3.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (16 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

In the EJB JAR Deployment Profile Properties pane, specify the enterprise application name as hrejb. Click OK.
4.

5. In the Resources node of the Application Navigator, right-click the deployment profile (ejb1.deploy) and select âœDeploy to JAR fileâ•.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (17 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

In the Deployment window, ensure the EJB JAR file was created and there were no errors.
6.

Create and Deploy a WAR file for the J2EE View Project
Back to List

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (18 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Expand the J2EEApplication node in the Application Navigator, right-click View node, and select New.
1.

2. From the âœDeployment Profilesâ• category, select âœWAR Fileâ• and click OK.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (19 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Accept the default Deployment Profile Name (webapp1). Click OK.


3.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (20 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

In the General Category pane, select the Specify J2EE Context Root radio-button and enter hrapp. Click OK.
4.

5. In the Resources node, right-click the deployment profile (webapp1.deploy) and select âœDeploy to WAR fileâ•.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (21 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

In the Deployment window, ensure the .war file was created.


6.

Create and Deploy an EAR file for the Complete J2EE Application

Back to List

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (22 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

With the J2EEApplication node expanded in the Application Navigator, right-click View node and select New.
1.

2. From the âœDeployment Profilesâ• category, select âœEAR Fileâ• and Click OK.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (23 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Accept the default Deployment Profile Name (application1). Click OK.


3.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (24 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

In the General category of the EAR Deployment Properties pane, name the application hr.
4.

In the Application Assembly node, select the check-boxes for the ejb1.deploy and webapp1.deploy to include them as part of the
5.
EAR deployment. Click OK.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (25 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

6. In the Resources node, right-click the deployment profile (application1.deploy) and select âœDeploy to -> â• and select the
name of your application server connection, (OracleAS10g).

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (26 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

7. When you see the text âœDeployment Finishedâ• in the message window, the application has deployed. It may take up to 5
minutes for this step to complete, depending on your hardware specifications.

Test the J2EE Application Deployment

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (27 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Back to List
Access the application by using the following URL: http://localhost/hrapp/login (the application has the "starter" Login.
1.
java servlet mapped to /login).

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (28 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Test the application and login using 100 as the Employee Id and King as the Employee Name.
2.

Step 4 - Deploy an ADF Application

In this step you create an archive for the J2EE components, deploy it to the Oracle Application Server 10g, and test it from a browser. .

Back to Topic List


Install the ADF Runtime Libraries
Create and Deploy a WAR file for the ADF ViewController Project
Test the ADF Application Deployment

Install the ADF Runtime Libraries

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (29 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Back to List

Shut down the Application Server services using the Application Server Control located by default at: http://localhost:1810.
1.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (30 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Shut down the OracleOraAS10ASControl and OracleOraAS10ProcessManager Application Server services from the operating
2.
system .

In JDeveloper, select Tools -> ADF Runtime Installer -> Oracle Application Server (this installs the necessary runtime files for
3.
either Oracle9iAS or Oracle Application Server 10g).

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (31 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Step your way through the ADF Runtime Installer.


4.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (32 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Specify the Application Server home directory then click Next.


5.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (33 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

In the Installation Options page, ensure Install a new version of the ADF runtime is selected and click Next.
6.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (34 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

On the Summary page, confirm your settings are correct and click Finish.
7.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (35 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

When the installation is finished, view the ias.html and confirm it was successful.
8.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (36 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (37 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Restart the Application Server services in Windows and access http://localhost:1810 to ensure that the application server is running
9.
and the home instance status is "up".

Create and Deploy a WAR file for the ADF ViewController Project

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (38 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Back to List

Expand the ADFApplication node in the Application Navigator, right-click ViewController node and select New.
1.

2. From the âœDeployment Profilesâ• category, select âœWAR Fileâ• and Click OK.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (39 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Accept the default Deployment Profile Name (webapp1). Click OK.


3.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (40 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

In the General Category page, select the Specify J2EE Context Root radio-button and enter adfapp. Click OK.
4.

5. In the Resources node, right-click the deployment profile (webapp1.deploy) and select âœDeploy to -> â• and select the name of
your application server connection, (OracleAS10g).

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (41 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

6. When you see the text âœDeployment Finishedâ• in the message window, the application has deployed. It may take up to 5
minutes for this step to complete, depending on your hardware specifications.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (42 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Test the ADF Application Deployment

Back to List
Access the application by using the following URL: http://localhost/adfapp/Login.jsp (the application has Login.jsp as
1.
its "starter" page.

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (43 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (44 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

Test the application and login using 100 as the Employee Id and King as the Employee Name.
2.

Summary

In this tutorial you archived and deployed a J2EE application and an ADF application to Oracle Application Server 10g.

Back to Topic List

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (45 of 46)2008/4/10 PM 01:52:33


lesson_Deployment

- Creating a JAR archive for the model components of a J2EE application


- Creating a WAR archive for the view components of a J2EE application
- Creating an EAR archive for the entire application
- Deploying the J2EE application to Oracle Application Server
- Testing the J2EE application deployment
- Installing the ADF runtime libraries
- Creating a WAR archive for the view components of an ADF application
- Deploying the ADF application to Oracle Application Server
- Testing the ADF application deployment

Related topics

Installing the Sample Schemas and Establishing a Database Connection

Move your mouse over this icon to hide all screenshots

E-mail this
page

Printer View
About Oracle | | Careers | Contact Us | Site Maps | Legal Notices | Terms of
Use | Privacy

file:///C|/Documents and Settings/sky.chan/桌面/lesson_Deployment.htm (46 of 46)2008/4/10 PM 01:52:33

You might also like