Oracle® Application Development Framework Developer's Guide
10g Release 3 (10.1.3) B25386-01 |
|
![]() Previous |
![]() Next |
To deploy an application, you perform these steps:
Step 1: Install the ADF Runtime Library on the Target Application Server
Step 2: Create a Connection to the Target Application Server
Step 3: Create a Deployment Profile for the JDeveloper Project
Step 4: Create Deployment Descriptors
Step 5: Perform Additional Configuration Tasks Needed for ADF
Step 6: Perform Application Server-Specific Configuration
Step 7: Deploy the Application
Step 1 Install the ADF Runtime Library on the Target Application Server
This step is required if you are deploying ADF applications to third-party application servers, and optional if you are deploying on Oracle Application Server or standalone OC4J. See Section 22.12, "Installing ADF Runtime Library on Third-Party Application Servers" for installation steps.
JSF applications that contain ADF Faces components have a few additional deployment requirements:
ADF Faces require Sun's JSF Reference Implementation 1.1_01 (or later) and MyFaces 1.0.8 (or later).
ADF Faces applications cannot run on an application server that only supports JSF 1.0.
Step 2 Create a Connection to the Target Application Server
In JDeveloper, create a connection to the application server where you want to deploy your application. Note that if your target application server is WebSphere, you can skip this step because JDeveloper cannot create a connection to WebSphere. For WebSphere, you deploy applications using the WebSphere console. See Section 22.9, "Deploying to WebSphere" for details.
To create a connection to an application server:
In the Connections Navigator, right click Application Server and choose New Application Server Connection. The Create Application Server Connection wizard opens.
Click Next to proceed to the Type page.
On the Type page:
Provide a name for the connection.
In the Connection Type list box, select the application server type. You can deploy ADF applications on these application servers:
Standalone OC4J 10.1.3
Oracle Application Server (10.1.2 or 10.1.3)
WebLogic Server (8.x or 9.x)
JBoss 4.0.x
Tomcat 5.x
Click Next.
If you selected Tomcat as the application server, the Tomcat Directory page appears. Enter the Tomcat's "webapps" directory as requested and click Next. This is the last screen for configuring a Tomcat server.
If you selected JBoss as the application server, the JBoss Directory page appears. Enter the JBoss's "deploy" directory as requested and click Next. This is the last screen for configuring a JBoss server.
On the Authentication page enter a user name and password that corresponds to the administrative user for the application server. Click Next.
On the Connection page, identify the server instance and configure the connection. Click Next.
On the Test page, test the connection. If not successful, return to the previous pages of the wizard to fix the configuration.
If you are using WebLogic, you may see this error when testing the connection:
Class Not Found Exception - weblogic.jndi.WLInitialContextFactory
This exception occurs when weblogic.jar
is not in JDeveloper's classpath. You may ignore this exception and continue with the deployment.
Click Finish.
Step 3 Create a Deployment Profile for the JDeveloper Project
Deployment profiles are project components that govern the deployment of a project or application. A deployment profile specifies the format and contents of the archive file that will be created.
To create a deployment profile:
In the Applications Navigator, select the project for which you want to create a profile.
Choose File > New to open the New Gallery.
In the Categories tree, expand General and select Deployment Profiles.
In the Items list, select a profile type. For ADF applications, you should select one of the following from the Items list:
WAR File
EAR File
EJB JAR File
You can also select Business Components Archive, if you are using ADF Business Components.
If the desired item is not found or enabled, make sure you selected the correct project, and select All Technologies in the Filter By dropdown list.
Click OK.
In the Create Deployment Profile dialog provide a name and location for the deployment profile, and click OK.
The profile, <name>.deploy, will be added to the project, and its Deployment Profile Properties dialog will open.
Select items in the left pane to open dialog pages in the right pane. Configure the profile by setting property values in the pages of the dialog.
Typically you can accept the default settings. One of the settings that you might want to change is the J2EE context root (select General on the left pane). By default, this is set to the project name. You need to change this if you want users to use a different name to access the application. Note that if you are using custom JAAS LoginModules for authentication with JAZN, the context root name also defines the application name that is used to look up the JAAS LoginModule.
Click OK to close the dialog.
Save the file to keep all changes.
To view or edit a deployment profile, right-click it in the Navigator, and choose Properties, or double-click the profile in the Navigator. This opens the Deployment Profile Properties dialog.
Step 4 Create Deployment Descriptors
Deployment descriptors are server configuration files used to define the configuration of an application for deployment and are deployed with the J2EE application as needed. The deployment descriptors a project requires depend on the technologies the project uses, and on the type of the target application server. Deployment descriptors are XML files that can be created and edited as source files, but for most descriptor types JDeveloper provides dialogs that you can use to view and set properties.
In addition to the standard J2EE deployment descriptors (for example: application.xml
, web.xml
, and ejb-jar.xml
), you can also have deployment descriptors that are specific to your target application server. For example, if you are deploying on Oracle Application Server, you can also have orion-application.xml
, orion-web.xml
, and orion-ejb-jar.xml
.
To create a deployment descriptor:
In the Applications Navigator, select the project for which you want to create a descriptor.
Choose File > New to open the New Gallery.
In the Categories tree, expand General and select Deployment Descriptors.
In the Items list, select a descriptor type, and click OK.
If the desired item is not found, make sure you selected the correct project, and select All Technologies in the Filter By dropdown list. If the desired item is not enabled, check to make sure the project does not already have a descriptor of that type. A project may have only one instance of a descriptor.
JDeveloper starts the Create Deployment Descriptor wizard or opens the file in the editor pane, depending on the type of deployment descriptor you selected.
Note: For EAR files, do not create more than one deployment descriptor per application or workspace. These files are assigned to projects, but have workspace scope. If multiple projects in an application or workspace have the same deployment descriptor, the one belonging to the launched project will supersede the others. This restriction applies toapplication.xml , data-sources.xml , jazn-data.xml , and orion-application.xml .
|
To view or change deployment descriptor properties:
In the Applications Navigator, right-click the deployment descriptor and choose Properties. If the context menu does not have a Properties item, then the descriptor must be edited as a source file. Choose Open from the context menu to open the profile in an XML editor window.
Select items in the left pane to open dialog pages in the right pane. Configure the descriptor by setting property values in the pages of the dialog.
Click OK when you are done.
To edit a deployment descriptor as an XML file:
In the Applications Navigator, right-click the deployment descriptor and choose Open. The file opens in an XML editor.
Step 5 Perform Additional Configuration Tasks Needed for ADF
If your application uses ADF Faces components, ensure that the standard J2EE deployment descriptors contain entries for ADF Faces, and that you include the ADF and JSF configuration files in your archive file (typically a WAR file). When you create ADF Faces components in your application, JDeveloper automatically creates and configures the files for you.
Check that the WAR file includes the following configuration and library files:
web.xml
—See Section 4.4.2.1, "More About the web.xml File" for ADF and JSF entries in this file.
faces-config.xml
and adf-faces-config.xml
files. See Section 4.4.2.2, "More About the faces-config.xml File" and Section 4.4.2.3, "Starter adf-faces-config.xml File" for details.
JAR files used by JSF and ADF Faces:
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
jsf-api.jar
and jsf-impl.jar
—These JAR files are the JSF reference implementation that JDeveloper includes by default.
Note: If you are using another JSF implementation (such as MyFaces), you must include the JAR files for those libraries when you create the deployment profile and remove the JSF JAR files (jsf-api.jar and jsf-impl.jar ) from the WAR file; otherwise, your application will not run correctly.
|
jstl.jar
and standard.jar
—These are the libraries for the JavaServer Pages Standard Tag Library (JSTL).
adf-faces-api.jar
—Located in the ADF Faces runtime library, this JAR contains all public ADF Faces APIs and is included in the WAR by default.
adf-faces-impl.jar
—Located in the ADF Faces runtime library, this JAR contains all private ADF Faces APIs and is included in the WAR by default.
adfshare.jar
—Located in the ADF Common runtime library, this JAR contains ADF Faces logging utilities.
If you have installed the ADF runtime libraries, which are required if you are deploying ADF Business Components, adfshare.jar
is included in the WAR by default. Otherwise, you must manually include adfshare.jar
in WEB-INF/lib
when creating the WAR deployment profile.
If you are using ADF databound UI components as described in Section 5.2, "Using the Data Control Palette to Create Databound UI Components", check that you have the DataBindings.cpx
file. For information about the file, see Section 5.3, "Working with the DataBindings.cpx File".
A typical WAR directory structure for a JSF application has the following layout:
MyApplication/ JSF pages WEB-INF/ configuration files (web.xml, faces-config.xml etc) tag library descriptors (optional) classes/ application class files Properties files lib/ commons-beanutils.jar commons-collections.jar commons-digester.jar commons-logging.jar jsf-api.jar jsf-impl.jar jstl.jar standard.jar
Step 6 Perform Application Server-Specific Configuration
Before you can deploy the application to your target application server, you may need to perform some vendor-specific configuration. See the specific application server sections later in this chapter.
Step 7 Deploy the Application
To deploy to the target application server from JDeveloper:
Right-click the deployment profile, choose Deploy to from the context menu, then select the application server connection that you created earlier (in step 2).
You can also use the deployment profile to create the archive file (EAR, WAR, or JAR file) only. You can then deploy the archive file using tools provided by the target application server. To create an archive file:
Right-click the deployment profile and choose Deploy to WAR file (or Deploy to EAR file) from the context menu.