Vous êtes sur la page 1sur 36

Deploying ADF Applications

Copyright 2008, Oracle. All rights reserved.


Objectives

After completing this lesson, you should be able to do the


following:
Create deployment profiles
Configure deployment options
Use JDeveloper to deploy an application
Use WebLogic Server administration console to deploy an
application
Use Ant to deploy an application
Test the deployed application

22 - 2 Copyright 2008, Oracle. All rights reserved.


Steps in the Deployment Process

Deployment tasks:
Prepare application or project for deployment.
Prepare Oracle WebLogic Server (WLS) for ADF
deployment.
Deploy the application with one of the following
techniques:
Deploy directly from JDeveloper to WLS.
Deploy to an EAR file and use application server tool for
deploying to the application server.
Use a script to deploy.

22 - 3 Copyright 2008, Oracle. All rights reserved.


Steps in the Deployment Process

Deployment tasks:
Prepare application or project for deployment.
Prepare Oracle WebLogic Server (WLS) for ADF
deployment.
Deploy the application with one of the following
techniques:
Deploy directly from JDeveloper to WLS.
Deploy to an EAR file and use application server tool for
deploying to the application server.
Use a script to deploy.

22 - 4 Copyright 2008, Oracle. All rights reserved.


Configuring Deployment Options

To configure an application for deployment, you create:


Deployment profile, which can be one of three types:
ADF Business Components: Business Component Java
ARchive (JAR)
Fusion Web application: Enterprise ARchive (EAR) and Web
ARchive (WAR) deployment profiles
Fusion Web application with customizations: Oracle ARchive
(OAR) and Metadata ARchive (MAR)
Deployment descriptors

22 - 5 Copyright 2008, Oracle. All rights reserved.


Creating Deployment Profiles

Deployment profiles:
Specify how application is packaged for deployment
Can be application level or project level
Creating an application For the Model project
deployment profile For the
View-Controller
project

22 - 6 Copyright 2008, Oracle. All rights reserved.


Specifying Deployment Profile Options

Deployment profile options:


Specified in profile
properties
Different depending on
type of profile

22 - 7 Copyright 2008, Oracle. All rights reserved.


Creating a
Business Components Deployment Profile

You can create business components deployment profiles by


using one of the following:
Context menu
Project Properties dialog box
New Gallery

22 - 8 Copyright 2008, Oracle. All rights reserved.


Web Module Deployment

It is used for deploying ADF BC applications to a Web tier.


It contains ADF BC components and JSPs and servlets.
It is used for deploying JSP, JSF, and servlet applications.
Deployment is to a Java EE archive (.ear or .war file).
JDeveloper creates the archive file and deployment
descriptors.

22 - 9 Copyright 2008, Oracle. All rights reserved.


Typical Web Application Deployment Example

To deploy a typical Web application that uses ADF Business


Components:
Create a WAR deployment profile for the UI project
Create an EAR deployment profile for the application
Deploy the application to the EAR file or directly to an
application server

22 - 10 Copyright 2008, Oracle. All rights reserved.


Example: Creating a WAR Deployment Profile for
the UI Project

1 3

Creates both .war and


.ear files

Context root becomes part of URL


to access the Web application.

22 - 11 Copyright 2008, Oracle. All rights reserved.


Example: Creating an EAR Deployment Profile for
the Application
1 3

2 4

22 - 12 Copyright 2008, Oracle. All rights reserved.


Using Deployment Descriptors

Deployment descriptors are:


Project configuration files deployed with the application
XML files of several types depending on project
technologies and deployment target
Created in various ways:
By JDeveloper wizards
As XML source files
By using the New Gallery

22 - 13 Copyright 2008, Oracle. All rights reserved.


Steps in the Deployment Process

Deployment tasks:
Prepare application or project for deployment.
Prepare Oracle WebLogic Server (WLS) for ADF
deployment.
Deploy the application with one of the following
techniques:
Deploy directly from JDeveloper to WLS.
Deploy to an EAR file and use application server tool for
deploying to the application server.
Use a script to deploy.

22 - 14 Copyright 2008, Oracle. All rights reserved.


Preparing the Oracle WebLogic Server

To deploy an application to Oracle WebLogic Server:


Install the ADF Runtime to the WebLogic installation
Create and configure the WebLogic domain
Create a JDBC data source
Additionally, you must configure the application to use the WLS
data source that you created.

22 - 15 Copyright 2008, Oracle. All rights reserved.


Installing the ADF Runtime to the WebLogic
Installation

If you need to, use the Oracle


Installer to add ADF Runtime to
the existing WebLogic installation.
Not needed if you:
Are using integrated WLS
Installed WLS with the
JDeveloper installer and selected
ADF Runtime option when
installing

22 - 16 Copyright 2008, Oracle. All rights reserved.


Creating and Configuring the WebLogic Domain

You need to have a WebLogic domain that is configured to


accept ADF applications.
Use the Oracle WebLogic Configuration Wizard to:
Create a new domain that is configured for ADF

OR

Configure an existing
domain for ADF

22 - 17 Copyright 2008, Oracle. All rights reserved.


Creating a JDBC Data Source

2
4

22 - 19 Copyright 2008, Oracle. All rights reserved.


Configuring the Data Control to Use
the Data Source
Define a new AM configuration:

Configure the data control:

22 - 21 Copyright 2008, Oracle. All rights reserved.


Steps in the Deployment Process

Deployment tasks:
Prepare application or project for deployment.
Prepare Oracle WebLogic Server (WLS) for ADF
deployment.
Deploy the application with one of the following
techniques:
Deploy directly from JDeveloper to WLS.
Deploy to an EAR file and use application server tool for
deploying to the application server.
Use a script to deploy.

22 - 23 Copyright 2008, Oracle. All rights reserved.


Creating a Connection to an
Application Server

Start the Application Server Connection Wizard: Right-click


IDE Connections > New Application Server Connection.
Enter the following:
Connection name
Connection type
Username and
password
Host name and RMI port
Test the connection.

22 - 24 Copyright 2008, Oracle. All rights reserved.


Example: Deploying the Application

1. Invoke the Application 3. Select a deployment


menu. profile.
2. Select Deploy. 4. Select to deploy to an
EAR file, an existing
1 connection, or a new
connection.

2 3
4

22 - 25 Copyright 2008, Oracle. All rights reserved.


Steps in the Deployment Process

Deployment tasks:
Prepare application or project for deployment.
Prepare Oracle WebLogic Server (WLS) for ADF
deployment.
Deploy the application with one of the following
techniques:
Deploy directly from JDeveloper to WLS.
Deploy to an EAR file and use application server tool
for deploying to the application server.
Use a script to deploy.

22 - 26 Copyright 2008, Oracle. All rights reserved.


Deploying the Application from the WebLogic
Administration Server Console

2 3

22 - 27 Copyright 2008, Oracle. All rights reserved.


Steps in the Deployment Process

Deployment tasks:
Prepare application or project for deployment.
Prepare Oracle WebLogic Server (WLS) for ADF
deployment.
Deploy the application with one of the following
techniques:
Deploy directly from JDeveloper to WLS.
Deploy to an EAR file and use application server tool for
deploying to the application server.
Use a script to deploy.

22 - 28 Copyright 2008, Oracle. All rights reserved.


Using Ant to Automate the Deployment Process

Ant is an XML scripting syntax


that enables you to build and deploy
Java EE applications.
Define named series of tasks
(called targets).
Define dependencies between targets.
Advantages of Ant:
Well-documented
Widely adopted
Easy to configure
Extensible
Obtain Ant information at: http://ant.apache.org

22 - 29 Copyright 2008, Oracle. All rights reserved.


Creating an Ant Buildfile in JDeveloper

1 2 3

4 5

22 - 30 Copyright 2008, Oracle. All rights reserved.


Defining Ant Deployment Tasks

Tasks for handling archive files:


<jar> <war>
<ejbjar> <unjar>
<ear> <unwar>
Tasks for local server deployment:
<copy>
<delete>
<java>
Tasks for remote deployment:
<ftp> <sleep>
<condition> <get>

22 - 31 Copyright 2008, Oracle. All rights reserved.


Adding Elements to the Buildfile

Adding a target: Adding a task:


1 1

2 2

3 3

22 - 32 Copyright 2008, Oracle. All rights reserved.


Running Ant on Buildfile Targets

Defining project buildfile and default target


Invoking the Run Ant Wizard
to specify advanced options.

Running Running on
on a target a project

Running Ant from the toolbar

22 - 33 Copyright 2008, Oracle. All rights reserved.


Creating an External Ant Tool

1 2

22 - 35 Copyright 2008, Oracle. All rights reserved.


Implementing Security in Deployed Applications

After deployment, you need to migrate to WLS the


applications:
Database credential store
Security policies
To help with this migration, you can:
Run command-line script
OR
Use simplified method with the supplied Ant script

22 - 36 Copyright 2008, Oracle. All rights reserved.


Deployment Testing During Development

Bind to an Oracle WebLogic Server instance:

22 - 38 Copyright 2008, Oracle. All rights reserved.


Deployment Testing for Production

Use a URL for production testing:

22 - 39 Copyright 2008, Oracle. All rights reserved.


Summary

In this lesson, you should have learned how to:


Create deployment profiles
Configure deployment options
Use JDeveloper to deploy an application
Use WebLogic Server administration console to deploy an
application
Use Ant to deploy an application
Test the deployed application

22 - 40 Copyright 2008, Oracle. All rights reserved.


Practice 22 Overview:
Deploying the Web Application

This practice covers the following topics:


Creating deployment profiles
Using a WebLogic Server data source
Creating an application server connection
Deploying the application from JDeveloper
Deploying the application from the WLS console
Running the deployed application

22 - 41 Copyright 2008, Oracle. All rights reserved.

Vous aimerez peut-être aussi