36 Deploying Fusion Web Applications

This chapter describes how to deploy Oracle ADF applications to a target application server. It describes how to create deployment profiles, how to create deployment descriptors, and how to load ADF runtime libraries. It also contains information on deploying to Oracle WebLogic Server.

This chapter includes the following sections:

36.1 Introduction to Deploying Fusion Web Applications

Deployment is the process of packaging application files as an archive file and transferring it to a target application server. You can use JDeveloper to deploy Oracle ADF applications directly to Oracle WebLogic Server, or indirectly to an archive file as the deployment target, and then install this archive file to the target server. For application development, you can also use JDeveloper to run an application in Integrated WebLogic Server. JDeveloper supports deploying to Oracle WebLogic Server clusters. You cannot use JDeveloper to deploy to individual Managed Servers within a cluster.

Note:

Normally, you use JDeveloper to deploy applications for development and testing purposes. If you are deploying Oracle ADF applications for production purposes, you can use Enterprise Manager or WLST scripts to deploy to production-level Oracle WebLogic Server.

For more information about deployment to later-stage testing or production environments, see the Oracle Fusion Middleware Administrator's Guide for Oracle Application Development Framework.

Oracle WebLogic Server Java EE applications are based on standardized, modular components. Oracle WebLogic Server provides a complete set of services for those modules and handles many details of application behavior automatically, without requiring programming. For information about which versions of Oracle WebLogic Server are compatible with JDeveloper, see the certification information website at http://www.oracle.com/technology/documentation/jdev.html.

Deploying a Fusion web application is slightly different from deploying a standard Java EE application. JSF applications that contain ADF Faces components have a few additional deployment requirements:

  • ADF Faces requires Sun's JSF Reference Implementation 1.2 and MyFaces 1.0.8 (or later).

You can use JDeveloper to:

  • Run applications in Integrated WebLogic Server

    You can run and debug applications using Integrated WebLogic Server.

  • Deploy to Oracle WebLogic Server

    You can deploy applications directly to Oracle WebLogic Server by creating a connection to the server and choosing the name of that server as the deployment target.

  • Deploy to an archive file

    You can deploy applications indirectly by choosing an EAR file as the deployment target. The archive file can subsequently be installed on a target Oracle WebLogic Server.

The StoreFront module of the Fusion Order Demo application demonstrates the use of the Fusion web application technology stack to create transaction-based web applications. You can run the StoreFront module of the Fusion Order Demo application in JDeveloper using Integrated WebLogic Server. You cannot run the Fusion Order Demo module in JDeveloper. You must deploy the Fusion Order Demo application to a SOA-enabled Oracle WebLogic Server. For more information about the StoreFront module and the Fusion Order Demo application, see Section 2.3, "Running the Fusion Order Demo Application StoreFront Module."

36.1.1 Developing Applications with Integrated WebLogic Server

If you are developing an application in JDeveloper and you want to run the application in Integrated WebLogic Server, you do not need to perform the tasks required for deploying directly to Oracle WebLogic Server or to an archive file. JDeveloper has a default connection to Integrated WebLogic Server and does not require any deployment profiles or descriptors. Integrated WebLogic Server has a preconfigured domain that includes the ADF libraries, as well as the -Djps.app.credential.overwrite.allowed=true setting, that are required to run Oracle ADF applications. You can run an application by choosing Run from the JDeveloper main menu.

You debug the application using the features described in Chapter 31, "Testing and Debugging ADF Components."

36.1.2 Developing Applications for Standalone Application Server

Typically, you test and develop your application by running it in Integrated WebLogic Server. You can then test the application further by deploying it to standalone Oracle WebLogic Server in development mode to more closely simulate the production environment.

In general, you use JDeveloper to prepare the application or project for deployment by:

  • Creating a connection to the target application server

  • Creating deployment profiles (if necessary)

  • Creating deployment descriptors (if necessary)

  • Updating application.xml and web.xml to be compatible with Oracle WebLogic Server (if required)

  • Enabling the application for Real User Experience Insight (RUEI) in web.xml (if desired)

  • Migrating application-level security policy data to a domain-level security policy store

  • Configuring the Oracle Single Sign-On (Oracle SSO) service and properties in the domain jps-config.xml file when you intend the web application to run using Oracle SSO

You must already have an installed Oracle WebLogic Server. If you do not, you can use the Oracle 11g Installer or the Oracle Fusion Middleware 11g Application Developer Installer to install one.

You also must prepare Oracle WebLogic Server for ADF application deployment by:

  • Installing the ADF runtime into the Oracle WebLogic Server installation:

    • If you installed Oracle WebLogic Server together with JDeveloper using the Oracle 11g Installer for JDeveloper, the ADF runtime should already be installed.

    • If the ADF runtime is not installed and you want to use Oracle Enterprise Manager to manage standalone ADF applications (which are applications without Oracle SOA Suite or Oracle WebCenter components), use the Oracle Fusion Middleware 11g Application Developer Installer. This installer will install the necessary Oracle Enterprise Manager components into the Oracle WebLogic installation.

    • If the ADF runtime is not installed and you do not need to install Enterprise Manager, use the Oracle 11g Installer for JDeveloper.

  • Extending Oracle WebLogic Server domain to be ADF-compatible using the ADF runtime

  • Setting the Oracle WebLogic Server credential store overwrite setting as required (-Djps.app.credential.overwrite.allowed=true setting)

  • Creating a global JDBC data source for applications that require a connection to a data source

After the application and Oracle WebLogic Server have been prepared, you can:

  • Use JDeveloper to:

    • Directly deploy to Oracle WebLogic Server using the deployment profile and the application server connection.

    • Deploy to an EAR file using the deployment profile. For Oracle ADF applications, WAR and MAR files can be deployed only as part of an EAR file.

  • Use Enterprise Manager, WLST scripts, or the Oracle WebLogic Server Administration Console to deploy the EAR file created in JDeveloper. For more information, see the Oracle Fusion Middleware Administrator's Guide for Oracle Application Development Framework.

36.2 Running an ADF Application in Integrated WebLogic Server

JDeveloper is installed with Integrated WebLogic Server which you can use to test and develop your application. For most development purposes, Integrated WebLogic Server will suffice. When your application is ready to be tested, you can select the run target and then choose the Run command from the main menu.

When you run the application target, JDeveloper detects the type of Java EE module to deploy based on artifacts in the projects and workspace. JDeveloper then creates an in-memory deployment profile for deploying the application to Integrated WebLogic Server. JDeveloper copies project and application workspace files to an "exploded EAR" directory structure. This file structure closely resembles the EAR file structure that you would have if you were to deploy the application to an EAR file. JDeveloper then follows the standard deployment procedures to register and deploy the "exploded EAR" files into Integrated WebLogic Server. The "exploded EAR" strategy reduces the performance overhead of packaging and unpackaging an actual EAR file.

In summary, when you select the run target and run the application in Integrated WebLogic Server, JDeveloper:

  • Detects the type of Java EE module to deploy based on the artifacts in the project and application

  • Creates a deployment profile in memory

  • Copies project and application files into a working directory with a file structure that would simulate the "exploded EAR" file of the application.

  • Performs the deployment tasks to register and deploy the simulated EAR into Integrated WebLogic Server

  • Automatically migrates identities, credentials, and policies

    Later on, if you plan to deploy the application to a standalone WebLogic Server instance, you will need to migrate this security information. For more information, see Section 36.3.4, "How to Deploy Applications with ADF Security Enabled."

Note:

JDeveloper ignores the deployment profiles that were created for the application when you run the application in Integrated WebLogic Server.

The application will run in the base domain in Integrated WebLogic Server. This base domain has the same configuration as a base domain in a standalone WebLogic Server instance. In other words, this base domain will be the same as if you had used the Oracle Fusion Middleware Configuration Wizard to create a base domain with the default options in a standalone WebLogic Server instance.

JDeveloper will extend this base domain with the necessary domain extension templates, based on the JDeveloper technology extensions. For example, if you have installed JDeveloper Studio, JDeveloper will automatically configure the Integrated WebLogic Server environment with the ADF runtime template (JRF Fusion Middleware runtime domain extension template).

You can explicitly create a default domain for Integrated WebLogic Server. You can use these domains to run and test your applications in addition to using the default domain. Open the Application Server Navigator, right-click IntegratedWebLogicServer and choose Create Default Domain.

JDeveloper has a default connection to Integrated WebLogic Server. You do not need to create a connection to run an application. If you do want to manually create an application server connection to Integrated WebLogic Server, use the instructions in Section 36.3.1, "How to Create a Connection to the Target Application Server," to create the connection, selecting Integrated Server instead of Standalone Server in Step 2.

36.2.1 How to Run an Application in Integrated WebLogic Server

You can test an application by running it in Integrated WebLogic Server. You can also set breakpoints and then run the application within the ADF Declarative Debugger.

To run an application in Integrated WebLogic Server:

  1. In the Application Navigator, select the project, unbounded task flow, JSF page, or file as the run target.

  2. Right-click the run target and choose Run or Debug.

36.2.2 How to Deploy a MAR Deployment Profile to Integrated WebLogic Server

When an application is running in Integrated WebLogic Server, the MAR profile itself will not be deployed to a repository, but a simulated MDS repository will be configured for the application that reflects the metadata information contained in the MAR. This metadata information is simulated, and the application runs based on this location in source control.

Any customizations or documents created by the application that are not configured to be stored in other MDS repositories are written to this simulated MDS repository directory. For example, if you customize an object, the customization is written to the simulated MDS repository. If you execute code that creates a new metadata object, then this new metadata object is also written to the same location in the simulated MDS repository. You can keep the default location for this directory (ORACLE_HOME\jdeveloper\systemXX.XX\o.mds.dt\adrs\Application\AutoGeneratedMar\mds_adrs_writedir), or you can set it to a different directory. You also have the option to preserve this directory across different application runs, or to delete this directory before each application run.

If your workspace has different working sets, only the metadata from the projects defined in the working set and their dependent projects will be included in the MAR. You can view and change a project's dependencies by right-clicking the project in the Application Navigator, choosing Project Properties, and then selecting Dependencies. For instance, an application may have several projects but workingsetA is defined to be viewcontroller2 and viewcontroller5; and viewcontroller5 has a dependency on modelproject1. When you run or debug workingsetA, only the metadata for viewcontroller2, viewcontroller5, and modelproject1 will be included in the MAR for deployment.

Before you begin:

There should already be a MAR profile, either generated automatically by JDeveloper, or manually generated by a user.

To deploy the MAR profile to Integrated WebLogic Server:

  1. In the Application Navigator, right-click the application and choose Application Properties.

  2. In the Application Properties dialog, expand Run and choose MDS.

  3. In the Run MDS page:

    • Select the MAR profile from the MAR Profile dropdown list

    • Enter a directory path in Override Location if you want to customize the location of the simulated MDS repository.

    • Select the Directory Content option. You can chose to preserve the customizations across application runs or delete customizations before each run.

    Select the MAR profile from the MAR Profile dropdown list. Figure 36-1 shows Demometadata1 selected as the MAR profile.

    Figure 36-1 Setting the Run MDS options

    Application roperties Run MDS options

36.3 Deployment Prerequisites

Before you deploy an ADF application to a standalone Oracle WebLogic Server, you must perform prerequisite tasks within JDeveloper to prepare the application for deployment.

The prerequisite tasks are:

  • Creating a connection to the target application server

  • Creating deployment profiles

  • Creating deployment descriptors

  • Migrating applicable security, credentials, identities, and policies

  • Replicating memory scopes in a clustered environment

  • Enabling the application for ADF MBeans (optional)

36.3.1 How to Create a Connection to the Target Application Server

You can deploy applications to Oracle WebLogic Server via JDeveloper application server connections. If your application involves customization using MDS, you should register your MDS repository with the Oracle WebLogic Server domain.

For more information about registering MDS, see the Oracle Fusion Middleware Administrator's Guide.

To create a connection to an application server:

  1. Launch the Application Server Connection wizard.

    You can:

    • In the Application Server Navigator, right-click Application Servers and choose New Application Server Connection.

    • In the New Gallery, expand General, select Connections and then Application Server Connection, and click OK.

    • In the Resource Palette, choose New > New Connections > Application Server.

  2. In the Create AppServer Connection dialog Usage page, select Standalone Server.

  3. In the Name and Type page, enter a connection name.

  4. In the Connection Type dropdown list, choose WebLogic to create a connection to Oracle WebLogic Server.

  5. Click Next.

  6. On the Authentication page, enter a user name and password for the administrative user authorized to access Oracle WebLogic Server.

  7. Click Next.

  8. On the Configuration page, enter a host name for Oracle WebLogic Server.

    The Oracle WebLogic host name is the name of the WebLogic Server instance containing the TCP/IP DNS where your application (.jar,.war,.ear) will be deployed.

  9. In the Port field, enter a port number for the Oracle WebLogic Server instance on which your application (.jar,.war,.ear) will be deployed.

    If you don't specify a port, the port number defaults to 7001.

  10. In the SSL Port field, enter an SSL port number for the Oracle WebLogic Server instance on which your application (.jar,.war,.ear) will be deployed.

    Specifying an SSL port is optional. It is required only if you want to ensure a secure connection for deployment.

    If you don't specify an SSL port, the port number defaults to 7002.

  11. Select Always Use SSL to connect to the Oracle WebLogic Server instance using the SSL port.

  12. Optionally enter a WebLogic Domain only if Oracle WebLogic Server is configured to distinguish nonadministrative server nodes by name.

  13. Click Next.

  14. On the Test page, click Test Connection to test the connection.

    JDeveloper performs several types of connections tests. The JSR-88 test must pass for the application to be deployable. If the test fails, return to the previous pages of the wizard to fix the configuration.

  15. Click Finish.

36.3.2 How to Create Deployment Profiles

A deployment profile defines the way the application is packaged into the archive that will be deployed to the target environment. The deployment profile:

  • Specifies the format and contents of the archive file that will be created

  • Lists the source files, deployment descriptors, and other auxiliary files that will be packaged

  • Describes the type and name of the archive file to be created

  • Highlights dependency information, platform-specific instructions, and other information

You need a WAR deployment profile for each web view-controller project that you want to deploy in your application. If you want to package seeded customizations or place base metadata in the MDS repository, you need an application-level metadata archive (MAR) deployment profile as well. For more information about seeded customizations, see Chapter 34, "Customizing Applications with MDS." If the application has customization classes, you need a JAR file for those classes and you need to add that JAR when you create the EAR file. Finally, you need an application-level EAR deployment profile and you must select the projects you want to include from a list, such as WAR and MAR profiles and customization classes JAR files. When the application is deployed, the EAR file will include all the projects that were selected in the deployment profile.

Note:

If you create your project or application using the Fusion Web Application (ADF) template, JDeveloper automatically creates default WAR, EAR, MAR, and JAR deployment profiles. Typically, you would not need to edit or create deployment profiles manually.

For Oracle ADF applications, you can deploy the application only as an EAR file. The WAR and MAR files that are part of the application should be included in the EAR file when you create the deployment profile.

Note:

If your ADF application has business services that you want to deploy, you will need to create a Business Component Service Interface deployment profile and deploy it. For more information about business services, see Section 11.2.19, "How to Deploy Web Services to Oracle WebLogic Server."

36.3.2.1 Adding Customization Classes into a JAR

If your application has customization classes, create a JAR that contains these customization classes. When you create your EAR, you can add the JAR to the EAR assembly.

Before you begin:

Make sure that your project has customization classes. You do not need to perform this procedure if the application does not have customization classes.

To add customization classes into a JAR:

  1. In the Application Navigator, right-click the data model project that you want to create a customization classes JAR for, and choose New.

  2. In the New Gallery, expand General, select Deployment Profile and then JAR File, and click OK.

    If you don't see Deployment Profiles in the Categories tree, click the All Technologies tab.

  3. In the Create Deployment Profile -- JAR File dialog, enter a name for the project deployment profile and click OK.

  4. In the Edit JAR Deployment Profile Properties dialog, select JAR Options.

  5. Enter the location for the JAR file.

  6. Expand Files Groups > Project Output > Filters.

  7. In the Files tab, select the customization classes you want to add to the JAR file. If you are using a customization.properties file, it needs to be in the same class loader as the JAR file. You can select the customization.properties file to package it along with the customization classes in the same JAR.

    Click OK to exit the Edit JAR Deployment Profile Properties dialog.

  8. Click OK again to exit the Project Properties dialog.

  9. In the Application Navigator, right-click the project containing the JAR deployment profile, and choose Deploy > deployment profile > to JAR file.

36.3.2.2 Creating a WAR Deployment Profile

You will need to create a WAR deployment profile for each web-based project you want to package into the application. Typically, the WAR profile will include the dependent model projects it requires.

Before you begin:

Create web-based projects. If you used the Fusion Web Application (ADF) template, you should already have a default WAR deployment profile.

To create WAR deployment profiles for an application:

  1. In the Application Navigator, right-click the web project that you want to deploy and choose New.

    You will create a WAR profile for each web project.

  2. In the New Gallery, expand General, select Deployment Profiles and then WAR File, and click OK.

    If you don't see Deployment Profiles in the Categories tree, click the All Technologies tab.

  3. In the Create Deployment Profile -- WAR File dialog, enter a name for the project deployment profile and click OK.

  4. In the Edit WAR Deployment Profile Properties dialog, choose 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.

    If you have customization classes in your application, they need to be configured to be loaded from the EAR-level application class loader and not from the WAR. You will later add these customization classes to the EAR. To make sure the customization classes are not duplicated in the WAR, be sure to select File Groups > WEB-INF/classes > Filters and deselect any customization classes for the WAR. If you are using a customization.properties file, it should also be deselected.

    Note:

    You may want to change the Java EE web context root setting (choose General in the left pane).

    By default, when Use Project's Java EE Web Context Root is selected, the associated value is set to the project name, for example, Application1-Project1-context-root. You need to change this if you want users to use a different name to access the application.

    If you are using custom JAAS LoginModule for authentication with JAZN, the context root name also defines the application name that is used to look up the JAAS LoginModule.

  5. Click OK to exit the Deployment Profile Properties dialog.

  6. Click OK again to exit the Project Properties dialog.

  7. Repeat Steps 1 through 7 for all web projects that you want to deploy.

36.3.2.3 Creating a MAR Deployment Profile

If you have seeded customizations or base metadata that you want to place in the MDS repository, you need to create a MAR deployment profile.

The namespace configuration under <mds-config> for MAR content in the adf-config.xml file is generated based on your selections in the MAR Deployment Profile Properties dialog.

Although uncommon, an enterprise application (packaged in an EAR) can contain multiple web application projects (packaged in multiple WARs), but the metadata for all these web applications will be packaged into a single metadata archive (MAR). The metadata contributed by each of these individual web applications can be global (available for all the web applications) or local to that particular web application.To avoid name conflicts for metadata with global scope, make sure that all metadata objects and elements have unique names across all the web application projects that forms part of the enterprise application.To avoid name conflicts and to ensure that the metadata for a particular web application remains local to that application, you can define a web-app-root for that web application project.The web-app-root is an element in the adf-settings.xml file for a web application project. The adf-settings.xml file should be kept in the META-INF directory under the public_html directory for the web project. Example 36-1 shows the contents of a sample adf-settings.xml file.

Example 36-1 web-app-root Element in the adf-settings.xml File

<?xml version="1.0" encoding="UTF-8" ?>
 <adf-settings xmlns="http://xmlns.oracle.com/adf/settings"
 xmlns:wap="http://xmlns.oracle.com/adf/share/http/config">
    <wap:adf-web-config xmlns="http://xmlns.oracle.com/adf/share/http/config">
        <web-app-root rootName="order"/>
    </wap:adf-web-config>
</adf-settings>

In this example, the adf-settings.xml file has a web-app-root element that defines the rootName as order.If your enterprise application has only one web application project then there is no need to define a web-app-root element. If your enterprise application has multiple web application projects, then you should supply a web-app-root for all the web applications except one, without which the deployment would fail. For example, if you have web-application1, web-application2, and web-application3, two of these web application projects must define a web-app-root to preclude any name conflicts.

JDeveloper creates an auto-generated MAR when the Enable User Customizations and Across Sessions using MDS options are selected in the ADF View page of the Project Properties dialog or when you explicitly specify the deployment target directory in the adf-config.xml file.

Before you begin:

Create an MDS repository for your customization requirements to deploy metadata using the MAR deployment profile. If you used the Fusion Web Application (ADF) template, you should already have a default MAR deployment profile.

To create a MAR deployment profile:

  1. In the Application Navigator, right-click the application and choose New.

    You will create a MAR profile if you want to include customizations.

  2. In the New Gallery, expand General, select Deployment Profiles and then MAR File, and click OK.

    If you don't see Deployment Profiles in the Categories tree, click the All Technologies tab.

  3. In the Create Deployment Profile -- MAR File dialog, enter a name for the MAR deployment profile and click OK.

  4. In the Edit MAR Deployment Profile Properties dialog, choose items in the left pane to open dialog pages in the right pane.

    Figure 36-2 shows a sample User Metadata directory tree.

    Figure 36-2 Selecting Items for the MAR Deployment Profiles

    MAR deployment profile dialog

    Note the following important points:

    • To include all customizations, you need only create a file group with the desired directories.

    • ADF Model and ADF view directories are added by default. No further action is required to package the ADF Model and ADF view customizations into the MAR. ADF view content is added to HTML Root dir, while ADF Model and Business Components content is added to User Metadata.

    • To include the base metadata in the MDS repository, you need to explicitly select these directories in the dialog.

      When you select the base document to be included in the MAR, you also select specific packages. When you select one package, all the documents (including subpackages) under that package will be used. When you select a package, you cannot deselect individual items under that package.

    • To include files from other than ADF Model and ADF view, users should create a new file group under User Metadata with the desired directories and explicitly select the required content in the Directories page.

    • If a dependent ADF library JAR for the project contains seeded customizations, they will automatically be added to the MAR during MAR packaging. They will not appear in the MAR profile.

    • If ADF Library customizations were created in the context of the consuming project, those customizations would appear in the MAR profile dialog by default.

  5. Click OK to exit the Deployment Profile Properties dialog.

  6. Click OK again to exit the Application Properties dialog.

36.3.2.4 Creating an Application-Level EAR Deployment Profile

The EAR file contains all the necessary application artifacts for the application to run in the application server. For more information about the EAR file, see Section 36.5.4, "What You May Need to Know About EAR Files and Packaging."

Before you begin:

Add classes into a JAR file, as described in Section 36.3.2.1, "Adding Customization Classes into a JAR." Create the WAR deployment profiles, as described in Section 36.3.2.2, "Creating a WAR Deployment Profile."

If you used the Fusion Web Application (ADF) template, you should already have a default EAR deployment profile.

To create an EAR deployment profile for an application:

  1. In the Application Navigator, right-click the application and choose New.

    You will create an EAR profile for the application.

  2. In the New Gallery, expand General, select Deployment Profiles and then EAR File, and click OK.

    If you don't see Deployment Profiles in the Categories tree, click the All Technologies tab.

  3. In the Create Deployment Profile -- EAR File dialog, enter a name for the application deployment profile and click OK.

  4. In the Edit EAR Deployment Profile Properties dialog, choose 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.

    Be sure that you:

    • Select Application Assembly and then in the Java EE Modules list, select all the project profiles that you want to include in the deployment, including any WAR or MAR profiles.

    • Select Platform, select WebLogic as the default platform, and then select the target application connection from the Target Connection dropdown list.

    If your application has customization classes, these classes need to be configured so that they load from the EAR-level application class loader. In Application Assembly, select the JAR that contains the customization classes and set Path in EAR to lib. You should have created this JAR as described in Section 36.3.2.1, "Adding Customization Classes into a JAR." The JAR files containing the customization classes is added to the EAR file's lib directory.

    Note:

    If you are using custom JAAS LoginModule for authentication with JAZN, the context root name also defines the application name that is used to look up the JAAS LoginModule.
  5. Click OK to exit the Deployment Profile Properties dialog.

  6. Click OK again to exit the Application Properties dialog.

36.3.2.5 Viewing and Changing Deployment Profile Properties

After you have created a deployment profile, you can view and change its properties.

To view, edit, or delete a project's deployment profile:

  1. In the Application Navigator, right-click the project and choose Project Properties.

  2. In the Project Properties dialog, click Deployment.

    The Deployment Profiles list displays all profiles currently defined for the project.

  3. In the list, select a deployment profile.

  4. To edit or delete a deployment profile, click Edit or Delete.

36.3.3 How to Create and Edit Deployment Descriptors

Deployment descriptors are server configuration files that define the configuration of an application for deployment and that are deployed with the Java EE application as needed. The deployment descriptors that 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 or an overview editor that you can use to view and set properties. If you cannot edit these files declaratively, JDeveloper opens the XML file in the source editor for you to edit its contents.

You can specify deployment descriptors that are specific to your target Oracle WebLogic application server.

In addition to the standard Java EE deployment descriptors (for example, application.xml and web.xml), you can also have deployment descriptors that are specific to your target application server. For example, if you are deploying to Oracle WebLogic Server, you can also have weblogic.xml, weblogic-application.xml, and weblogic-ejb-jar.xml.

Make sure that the application EAR file includes a weblogic-application.xml file that contains a reference to adf.oracle.domain, and that it includes an ADFApplicationLifecycleListener to clean up application resources between deployment and undeployment actions. Example 36-2 shows a sample weblogic-application.xml file.

Example 36-2 Sample weblogic-application.xml

<weblogic-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-application.xsd"
 xmlns="http://www.bea.com/ns/weblogic/weblogic-application">
  <listener>
    <listener-class>oracle.adf.share.weblogic.listeners.
          ADFApplicationLifecycleListener</listener-class>
  </listener>
  <listener>
    <listener-class>oracle.mds.lcm.weblogic.WLLifecycleListener</listener-class>
  </listener>
  <library-ref>
    <library-name>adf.oracle.domain</library-name>
       <implementation-version>11.1.1.1.0
       </implementation-version>
    </library-ref>
</weblogic-application>

If you are deploying web services, you may need to modify your weblogic-application.xml and web.xml files as described in Section 11.2.19, "How to Deploy Web Services to Oracle WebLogic Server."

If you want to enable the application for Real User Experience Insight (RUEI) monitoring, you must add a parameter to the web.xml file, as described in Section 36.3.3.5, "Enabling the Application for Real User Experience Insight."

During deployment, the application's security properties are written to the weblogic-application.xml file to be deployed with the application in the EAR file. For more information, see Section 30.8.2, "What Happens When You Configure Security Deployment Options."

Because Oracle WebLogic Server runs on Java EE 1.5, you may need to modify the application.xml and web.xml files to be compatible with Oracle WebLogic Server.

36.3.3.1 Creating Deployment Descriptors

JDeveloper automatically creates many of the required deployment descriptors for you. If they are not present, or if you need to create additional descriptors, you can use JDeveloper to create them.

Before you begin:

Check to see whether JDeveloper has already generated deployment descriptors.

To create a deployment descriptor:

  1. In the Application Navigator, right-click the project for which you want to create a descriptor and choose New.

  2. In the New Gallery, expand General, select Deployment Descriptors and then a descriptor type, and click OK.

    If you can't find the item you want, make sure that you chose the correct project, and then choose the All Technologies tab or use the Search field to find the descriptor. If the item is not enabled, check to make sure that the project does not already have a descriptor of that type. A project is allowed only one instance of a descriptor.

    JDeveloper starts the Create Deployment Descriptor wizard and then opens the file in the overview or source editor, depending on the type of deployment descriptor you choose.

Note:

For EAR files, do not create more than one deployment descriptor per application or workspace. These files are assigned to projects, but have application workspace scope. If multiple projects in an application have the same deployment descriptor, the one belonging to the launched project will supersede the others. This restriction applies to application.xml, weblogic-jdbc.xml, jazn-data.xml, and weblogic.xml.

The best place to create an application-level descriptor is in the Descriptors node of the Application Resources panel in the Application Navigator. This ensures that the application is created with the correct descriptors.

36.3.3.2 Viewing or Modifying Deployment Descriptor Properties

After you have created a deployment descriptor, you can change its properties by using JDeveloper dialogs or by editing the file in the source editor. The deployment descriptor is an XML file (for example, application.xml) typically located under the Application Sources node.

To view or change deployment descriptor properties:

  1. In the Application Navigator or in the Application Resources panel, double-click the deployment descriptor.

  2. In the overview editor, select either the Overview tab or the Source tab, and configure the descriptor by setting property values.

    If the overview editor is not available, JDeveloper opens the file in the source editor.

36.3.3.3 Configuring the application.xml File for WebLogic Compatibility

You may need to configure your application.xml file to be compliant with Java EE 1.5.

Note:

Typically, your project has an application.xml file that is compatible and you would not need to perform this procedure.

To configure the application.xml file:

  1. In the Application Navigator, right-click the project and choose New.

  2. In the New Gallery, expand General, select Deployment Descriptors and then Java EE Deployment Descriptor Wizard, and click OK.

  3. In the Select Descriptor page of the Create Java EE Deployment Descriptor dialog, select application.xml and click Next.

  4. In the Select Version page, select 5.0 and click Next.

  5. In the Summary page, click Finish.

  6. Edit the application.xml file with the appropriate values.

36.3.3.4 Configuring the web.xml File for WebLogic Compatibility

You may need to configure your web.xml file to be compliant with Java EE 1.5 (which corresponds to servlet 2.5 and JSP 1.2). For more information, see Section A.13, "web.xml."

Note:

Typically, your project has a web.xml file that is compatible and you would not need to perform this procedure. JDeveloper creates a starter web.xml file when you create a project.

To configure the web.xml file:

  1. In the Application Navigator, right-click the project and choose New.

  2. In the New Gallery, expand General, select Deployment Descriptors and then Java EE Deployment Descriptor Wizard, and click OK.

  3. In the Select Descriptor page of the Create Java EE Deployment Descriptor dialog, select web.xml and click Next.

  4. In the Select Version page, select 2.5 and click Next.

  5. In the Summary page, click Finish.

36.3.3.5 Enabling the Application for Real User Experience Insight

Real User Experience Insight (RUEI) is a web-based utility to report on real-user traffic requested by, and generated from, your network. It measures the response times of pages and transactions at the most critical points in the network infrastructure. Session diagnostics allow you to perform root-cause analysis.

RUEI enables you to view server and network times based on the real-user experience, to monitor your Key Performance Indicators (KPIs) and Service Level Agreements (SLAs), and to trigger alert notifications on incidents that violate their defined targets. You can implement checks on page content, site errors, and the functional requirements of transactions. Using this information, you can verify your business and technical operations. You can also set custom alerts on the availability, throughput, and traffic of all items identified in RUEI.

For more information about RUEI, see the Oracle Real User Experience Insight User's Guide.

You must enable an application for RUEI by adding the following context-param tag to the web.xml file, as shown in Example 36-3.

Example 36-3 Enabling RUEI Monitoring for an Application in web.xml

<context-param>
  <description>This parameter notifies ADF Faces that the 
               ExecutionContextProvider service provider is enabled.
               When enabled, this will start monitoring and aggregating
               user activity information for the client initiated
               requests. By default this param is not set or is false.
  </description>
  <param-name>
         oracle.adf.view.faces.context.ENABLE_ADF_EXECUTION_CONTEXT_PROVIDER
  </param-name>
  <param-value>true</param-value>
</context-param>

36.3.4 How to Deploy Applications with ADF Security Enabled

If you are developing an application in JDeveloper using Integrated WebLogic Server, application security deployment properties are configured by default, which means that the application and security credentials and policies will be overwritten each time you redeploy for development purposes. You can change the default behavior in the Application Properties dialog, as described in Section 30.8.1, "How to Configure, Deploy, and Run a Secure Application in JDeveloper."

In a development environment, JDeveloper will automatically migrate application-level credentials, identities, and policies to the remote WebLogic Server instance only if the server is set up to be in development mode. Integrated WebLogic Server is set up in development mode by default. You can set up a remote WebLogic Server to be in development mode during Oracle WebLogic Server domain creation using the Oracle Fusion Middleware Configuration Wizard. For more information about configuring Oracle WebLogic Server domains, see Oracle Fusion Middleware Creating Domains Using the Configuration Wizard.

JDeveloper will not migrate application-level security credentials to WebLogic Server setup in production mode. Typically, in a production environment, administrators will use Enterprise Manager or WLST scripts to deploy an application, including its security requirements.

When you deploy an application to WebLogic Server, credentials and policies (in the cwallet.sso and jps-config.xml and jazn-data.xml files) will either overwrite or merge with the WebLogic Server's domain-level credential and policy stores, depending on whether the domain-level store is in OVERWRITE or MERGE mode. In production-mode WebLogic Server, to avoid security risks, only MERGE mode is allowed. For development-mode WebLogic Server, you can set the mode to OVERWRITE to test user names and passwords. You can set the mode by running setDomainEnv.cmd or setDomainEnv.sh with the following option added to the command (usually located in ORACLE_HOME/user_projects/domains/MyDomain/bin).

For setDomainEnv.cmd:

set EXTRA_JAVA_PROPERTIES=-Djps.app.credential.overwrite.allowed=true 
    %EXTRA_JAVA_PROPERTIES%

For setDomainEnv.sh:

EXTRA_JAVA_PROPERTIES="-Djps.app.credential.overwrite.allowed=true
     ${EXTRA_JAVA_PROPERTIES}"
export EXTRA_JAVA_PROPERTIES

If the Administration Server is already running, you must restart it for this setting to take effect.

You can check to see whether WebLogic Server is in production mode by using the Oracle WebLogic Server Administration Console or by verifying the following line in WebLogic Server's config.xml file:

<production-mode-enabled>true</production-mode-enabled>

By default, JDeveloper sets the application's credential, identities, and policies to OVERWRITE mode. That is, the Application Policies, Credentials, and Users and Groups options are selected by default in the Application Properties dialog Deployment page. However, an application's credentials, identities, and policies will be migrated only if the target WebLogic Server instance is set to development mode with -Djps.app.credential.overwrite.allowed=true

When your application is ready for deployment to a production environment, you should remove the identities from the jazn-data.xml file or disable the migration of identities by deselecting Users and Groups from the Application Properties dialog. Application credentials must be manually migrated outside of JDeveloper.

For information about setting credentials in a production enviroment using Enterprise Manager Fusion Middleware Control or WLST scripts, see the Oracle Fusion Middleware Administrator's Guide for Oracle Application Development Framework.

For more information about migrating application credentials and other jazn-data user credentials, see the Oracle Fusion Middleware Security Guide.

36.3.4.1 Applications with JDBC URL

If your application has components that use JDBC URL connections, the connection user names and passwords are also stored in the application-level credential and policy stores. For the deployed application to be able to connect to the database using the JDBC URL, these credentials and policies must be migrated. That is, if WebLogic Server is in production mode, system administrators must migrate this security information. If WebLogic Server is in development mode, it must have domain-level credential and policy stores set to OVERWRITE to allow the migration of security information.

36.3.4.2 Applications with JDBC Data Source

If your application uses application-level JDBC data sources with password indirection for database connections, you may need to create credential maps in WebLogic Server to enable the database connection. For more information, see Section 36.4.3, "How to Create a JDBC Data Source for Oracle WebLogic Server."

36.3.4.3 Applications That Will Run Using Oracle Single Sign-On (SSO)

Before you can deploy and run the web application with Oracle ADF Security enabled on Oracle WebLogic Server, the administrator of the target server must configure the domain-level jps-config.xml file for the Oracle Access Manager (OAM) security provider. To assist with this configuration task, an Oracle WebLogic Scripting Tool (WLST) script has been provided with the JDeveloper install. For details about running this configuration script (with command addOAMSSOProvider(loginuri, logouturi, autologinuri)), see the procedure for configuring Oracle WebLogic Server for a web application using ADF Security, OAM SSO, and OPSS SSO in the Oracle Fusion Middleware Security Guide.

Running the configuration script ensures that the ADF Security framework defers to the OAM service provider to clear the ObSSOCookie token. OAM uses this token to save the identity of authenticated users and, unless it is cleared during logout, the user will be unable to log out.

After the system administrator runs the script on the target server, the domain jps-config.xml file will contain the following security provider definition that is specific for ADF Security:

<propertySet name="props.auth.uri">
    <property name="login.url.FORM" value="/${app.context}/adfAuthentication"/>
    <property name="logout.url" value=""/>
</propertySet>

Additionally, the authentication type required by SSO is CLIENT-CERT. The web.xml authentication configuration for the deployed application must specify the <auth-method> element as one of the following CLIENT-CERT types.

For FORM-type authentication method, specify the elements like this:

<login-config>
  <auth-method>CLIENT-CERT,FORM</auth-method>
  <realm-name>myrealm</realm-name>
  <form-login-config>
     <form-login-page>/login.html</form-login-page>
     <form-error-page>/error.html</form-error-page>
  </form-login-config>
</login-config>

For BASIC-type authentication method, specify the elements like this:

<login-config>
   <auth-method>CLIENT-CERT,BASIC</auth-method>
   <realm-name>myrealm</realm-name>
</login-config>

You can configure the web.xml file either before or after deploying the web application. For further details about setting up the authentication method for Single Sign-On, see the Oracle Fusion Middleware Security Guide.

36.3.5 How to Replicate Memory Scopes in a Clustered Environment

If you are deploying an application that is intended to run in a clustered environment, you need to ensure that all managed beans with a lifespan longer than one request are serializable, and that the ADF framework is aware of changes to managed beans stored in ADF scopes (view scope and page flow scope).

For more information, see Section 20.4.3, "How to Set Managed Bean Memory Scopes in a Server-Cluster Environment."

36.3.6 How to Enable the Application for ADF MBeans

An ADF application uses many XML files for setting configuration information. Three of these configuration files have ADF MBean counterparts that are deployed with the application. After the application has been deployed, you can change configuration properties by accessing the ADF MBeans using the Enterprise Manager Fusion Middleware Control MBean browser.

To enable ADF MBeans, you must register them in the web.xml file. Example 36-4 shows a web.xml file with listener entries for connections, configuration, and business components.

Example 36-4 Enabling ADF MBeans in the web.xml File

<listener>
   <listener-class>
        oracle.adf.mbean.share.connection.ADFConnectionLifeCycleCallBack
   </listener-class>
</listener>
<listener>
   <listener-class>
        oracle.adf.mbean.share.config.ADFConfigLifeCycleCallBack</listener-class>
</listener>
<listener>
   <listener-class>
        oracle.bc4j.mbean.BC4JConfigLifeCycleCallBack</listener-class>
</listener>

Additionally, ADF connection MBeans require the application to be configured with an MDS repository. ADF Business Components MBeans do not require MDS, but business components configuration is limited to updating the underlying bc4j.xcfg file in the exploded EAR location. MDS configuration entries in the adf-config.xml file for a file-based MDS are shown in Example 36-5. For more information about configuring MDS, see the Oracle Fusion Middleware Administrator's Guide.

Example 36-5 MDS Configuration Entries in the adf-config.xml File

<adf-mds-config xmlns="http://xmlns.oracle.com/adf/mds/config">
   <mds-config xmlns="http://xmlns.oracle.com/mds/config" version="11.1.1.000">
      <persistence-config>
         <metadata-store-usages>
            <metadata-store-usage 
                default-cust-store="true" deploy-target="true" id="myFileStore">
                  <metadata-store name="myReposName"
                       class-name=
                          "oracle.mds.persistence.stores.file.FileMetadataStore">
                       <property name="metadata-path" value="C:\Temp\"/>
                       <property name="partition-name" value="myAppName"/>
                  </metadata-store>
            </metadata-store-usage>
         </metadata-store-usages>
      </persistence-config>
   </mds-config>
</adf-mds-config>

In a production environment, an MDS repository that uses a database is required. You can use JDeveloper, Enterprise Manager Fusion Middleware Control, or WLST commands to switch from a file-based repository to a database MDS repository.

Additionally, if several applications are sharing the same MDS configuration, each application can achieve distinct customization layers by defining a adf:adf-properties-child property in the adf-config.xml file. JDeveloper automatically generates this entry when creating applications. If your adf-config.xml file does not have this entry, add it to the file with code similar to that of Example 36-6.

Example 36-6 Adding MDS Partition Code to the adf-config.xml File

<adf:adf-properties-child xmlns="http://xmlns.oracle.com/adf/config/properties">
     <adf-property name="adfAppUID" value="Application3-4434"/>
     <adf-property name="partition_customizations_by_application_id"
            value="true"/>
</adf:adf-properties-child> 

The value attribute is either generated by JDeveloper or you can set it to any unique identifier within the server farm where the application is deployed. This value can be set to the value attribute of the adfAppUID property.

When adf-property name is set to adfAppUid, then the corresponding value property should be set to the name of the application. By default, JDeveloper generates the value property using the application's package name. If the package name is not specified, JDeveloper generates the value property by using the workspace name and a four digit random number.

For more information about configuring ADF applications using ADF MBeans, see the Oracle Fusion Middleware Administrator's Guide for Oracle Application Development Framework.

36.4 Preparing the Target Environment

To run ADF applications, you must install target Oracle WebLogic Server with the Oracle ADF runtime. You can include the ADF runtime during a new WebLogic Server installation or you can install the ADF runtime into an existing WebLogic Server installation.

After WebLogic Server has the ADF runtime installed, you can create a new WebLogic domain or you can extend an existing WebLogic Server domain for Oracle ADF.

If the Managed Servers are on a different host than the Administration Server, you must perform additional configuration tasks for the Managed Servers to enable them to host ADF applications.

An ADF application will use either a JDBC data source or a JDBC URL to access its data. You can configure WebLogic Server with the data source using the Oracle WebLogic Server Administration Console.

36.4.1 How to Install the ADF Runtime to the WebLogic Server Installation

Oracle WebLogic Server requires the ADF runtime to run Oracle ADF applications.

Installing the ADF runtime is not required if you are using JDeveloper to run applications in Integrated WebLogic Server.

You can install the ADF runtime using the following installers:

  • Oracle 11g Installer for JDeveloper: Installs JDeveloper, the ADF runtime, and Oracle WebLogic Server. It does not install Oracle Enterprise Manager.

  • Oracle Fusion Middleware 11g Application Developer Installer: Installs the ADF runtime and Oracle Enterprise Manager. You should use the Oracle Fusion Middleware 11g Application Developer Installer if you want to use Oracle Enterprise Manager to manage standalone ADF applications (without Oracle SOA Suite or Oracle WebCenter components). You must have already installed Oracle WebLogic Server before you can use this installer.

If you installed Oracle WebLogic Server together with JDeveloper 11g using the Oracle 11g Installer for JDeveloper (or if you installed it with the Application Development Framework Runtime option selected), the ADF runtime is installed as part of the Oracle WebLogic Server installation. You can proceed to Section 36.4.2, "How to Create and Extend Oracle WebLogic Server Domains."

36.4.1.1 Installing the ADF Runtime into an Existing WebLogic Server Installation Using the Oracle Fusion Middleware Application Developer Installer

You can use the Oracle Fusion Middleware 11g Application Developer Installer to install the ADF runtime and Enterprise Manager.

Before you begin:

Install Oracle WebLogic Server. You must also have obtained the Oracle Fusion Middleware 11g Application Developer Installer. You can download the installer from the Oracle Technology Network (OTN) web site at http://www.oracle.com/technology/products/middleware/index.html.

Use the instructions in the Oracle Fusion Middleware Installation Planning Guide to start the installer and to complete the installation.

After you have installed the ADF runtime, follow the instructions in Section 36.4.2, "How to Create and Extend Oracle WebLogic Server Domains," to use the Oracle Fusion Middleware Configuration Wizard to create or extend the Oracle WebLogic Server domain.

36.4.1.2 Installing the ADF Runtime into an Existing WebLogic Server Installation Using the Oracle Installer for JDeveloper

Before you begin:

Obtain the Oracle 11g Installer for JDeveloper. You can download the installer from the Oracle Technology Network (OTN) web site at http://www.oracle.com/technology/software/products/jdev/index.html.

Use the instructions in the Oracle Fusion Middleware Installation Guide for Oracle JDeveloper to start the installer and to complete the installation.

Note:

Ensure that you download and install 11g and that it is the Studio Edition, not the Java Edition. You can verify these details in Oracle JDeveloper from the Help > About menu option.

To install the ADF runtime into an existing WebLogic Server:

  1. Start the Oracle 11g Installer for JDeveloper as described in the Oracle Fusion Middleware Installation Guide for Oracle JDeveloper.

  2. In the Choose Middleware Home directory page, select Use an existing Middleware Home, select the directory in which your Oracle WebLogic Server resides, and click Next.

  3. In the Choose Products and Components page, select Application Development Framework Runtime (deselect JDeveloper Studio if you do not want to install the JDeveloper IDE), and click Next.

    Oracle WebLogic Server product and components should be gray and unselectable. If they are enabled and selected, you must check to see whether you have selected the correct Oracle WebLogic Server installation directory.

  4. Follow the instructions in the Oracle Fusion Middleware Installation Guide for Oracle JDeveloper.

  5. When the installation is complete, click Done.

    Follow the instructions in Section 36.3.3, "How to Create and Edit Deployment Descriptors," to use the Oracle Fusion Middleware Configuration Wizard to create or extend Oracle WebLogic Server domains.

36.4.2 How to Create and Extend Oracle WebLogic Server Domains

You need to create and configure the Oracle WebLogic Server domain to accept Oracle ADF applications. If you do not already have a domain, you need to create one. If you already have a domain, you must extend the domain before it can run Oracle ADF applications.

If you are using Managed Servers to run your applications, you may need to configure your Managed Server. For more information about configuring a Managed Server on Oracle WebLogic Server, see Oracle Fusion Middleware Creating Domains Using the Configuration Wizard.

If you are setting up Managed Servers for Oracle ADF where the Managed Servers are on the same host as the Administration Server, follow the instructions described in this section.

If you are setting up to deploy to Managed Servers that are on a different host than the Administration Server, perform the additional steps described in Section 36.4.2.3, "Setting Up Remote Managed Servers for Oracle ADF."

36.4.2.1 Creating an Oracle WebLogic Server Domain for Oracle ADF

You must create an Oracle WebLogic Server domain if it does not already exist.

To create a new Oracle WebLogic Server domain:

  1. Start the Oracle Fusion Middleware Configuration wizard.

    • If you used the Oracle Installer for JDeveloper, run ORACLE_HOME/jdeveloper/common/bin/config.cmd (or config.sh, depending on your platform) from the command prompt.

    • If you used the Oracle Fusion Middleware Application Developer Installer, run WL_HOME/wlserver_10.3/common/bin/config.exe (or config.sh, depending on your platform) from the command prompt.

  2. In the Welcome page, select Create a New WebLogic Domain and click Next.

  3. In the Select Domain Source page, select Generate a domain configured automatically to support the following products.

    • If you used the Oracle Installer for JDeveloper, select Oracle JRF and click Next.

      The option Basic WebLogic Server Domain (Required) is already selected.

    • If you used the Oracle Fusion Middleware Application Developer Installer, select Oracle JRF and optionally select Oracle Enterprise Manager and click Next.

  4. In the Specify Domain Name and Location page, enter the domain name and location.

  5. In the Configure Administrator Username and Password page, enter the user name and password and click Next.

  6. In the Configure Server Start Mode and JDK page, select whether the domain is for a development or a production system, choose the JDK to use, and click Next.

  7. In the Select Optional Configuration page, leave the options unselected to keep the default settings and click Next.

  8. In the Configuration Summary page, review the selections you have made. If you want to change a selection, click Previous to go back to that page. When you are satisfied with your selections, click Create.

  9. Click Done when the creation process has finished.

36.4.2.2 Extending the Oracle WebLogic Server Domain for Oracle ADF

Before you begin:

You must already have an existing Oracle WebLogic Server domain with the ADF runtime installed.

To extend an Oracle WebLogic Server domain for Oracle ADF:

  1. Start the Oracle Fusion Middleware Configuration wizard.

    • If you used the Oracle Installer for JDeveloper, run ORACLE_HOME/jdeveloper/common/bin/config.cmd (or config.sh, depending on your platform) from the command prompt.

    • If you used the Oracle Fusion Middleware Application Developer Installer, run WL_HOME/wlserver_10.3/common/bin/config.exe (or config.sh, depending on your platform) from the command prompt.

  2. In the Welcome page, select Extend an existing WebLogic domain and click Next.

  3. In the Select a WebLogic Domain Directory page, select the location of the domain you want to configure for Oracle ADF, and click Next.

  4. In the Select Extension Source page, select Extend my domain automatically to support the following added products.

    • If you used the Oracle Installer for JDeveloper, select Oracle JRF and click Next.

      The option Basic WebLogic Server Domain (Required) is already selected.

    • If you used the Oracle Fusion Middleware Application Developer Installer, select Oracle JRF and optionally select Oracle Enterprise Manager and click Next.

  5. In the Select Advanced Configuration page, leave the options unselected to keep the default setting and click Next.

  6. In the Configuration Summary page, review the selections you have made. If you want to change a selection, click Previous to go back to that page. When you are satisfied with your selections, click Extend.

  7. Click Done when the configuration has finished.

    This configures the rest of the runtime .jar files using the manifest file.

Note:

Your application's EAR file must have a weblogic-application.xml file containing a reference to the adf.oracle.domain shared library.

You can now start Oracle WebLogic Server by running the command-line script ORACLE_HOME\user_projects\domains\domain_name\bin\startWebLogic.cmd, and you can stop the server using the stopWebLogic.cmd script in the same directory. For Linux platforms, use \bin\startWebLogic.sh and stopWebLogic.sh respectively.

Access the Oracle WebLogic Server Administration Console using the URL http://localhost:7001/console.

36.4.2.3 Setting Up Remote Managed Servers for Oracle ADF

If the Managed Servers are on a different host are on a different host than the Administration Server, you need to perform additional steps.

You will need to set up Managed Servers for Oracle ADF on the host with the Administration Server, pack the JRF template, copy it to the remote host, and unpack the template.

To set up remote Managed Servers for Oracle ADF:

  1. Use the Oracle Installer for JDeveloper to install Oracle WebLogic Server installations on both the local and remote hosts, if not already installed. If you are not installing JDeveloper Studio, you need to select the Application Development Framework Runtime option in the installer. The local host is the host with the Administration Server.

    Or, if there are existing Weblogic Server installations, use the Oracle Installer for JDeveloper to install the ADF runtime into the WebLogic Server installations on both hosts by selecting the Application Development Framework Runtime option. For more information on installation, see Section 36.4.1, "How to Install the ADF Runtime to the WebLogic Server Installation."

  2. Run the Oracle Fusion Middleware Configuration Wizard to create a new Oracle WebLogic Server domain. In the wizard, select the Oracle JRF option, as described in Section 36.4.2.1, "Creating an Oracle WebLogic Server Domain for Oracle ADF."

  3. On both hosts, run the Oracle Fusion Middleware Configuration Wizard to create Managed Servers.

  4. On the local host, start the Administration Server and the Managed Server.

    For example,

    cd ORACLE_HOME/user_projects/domain/base_domain/bin
    ./startWeblogic.sh
    ./startManagedWebLogic.sh ManagedServer_1 http://localhost:7001
    
    
  5. On the local host, pack the Managed Server configuration information into a JAR and then copy the JAR to the remote host. This JAR contains the JRF template information.

    For example,

    cd ORACLE_HOME/jdeveloper/common/bin./pack.sh -managed=true -domain=../../../user_projects/domains/base_domain
         -template=../../../base_domain_managed.jar -template_name=
         "Base Managed Server Domain"
    cp ../../../base_domain_managed.jar remote_machine_ORACLE_HOME/
    
  6. On the remote host, unpack the Managed Server configuration JAR.

    For example,

    cd ORACLE_HOME/jdeveloper/common/bin
    ./unpack.sh -domain=../../../user_projects/domains/base_domain
             -template=../../../base_domain_managed.jar
    

    If the Managed Server was created after the domain was, you must delete the entire domain configuration directory of the Managed Server before running unpack.

  7. On the remote host, start the Node Manager.

    For example,

    cd ORACLE_HOME/wlserver_10.3/server/bin
    ./startNodeManager.sh
    
  8. On the remote host, if the Managed Server was not created with the JRF template applied, run the applyJRF WLST command to extend the Managed Server with the JRF template.

    Also, if the Managed Server was created after the domain was, you must delete the entire domain configuration directory of the Managed Server before running applyJRF.

  9. On the both hosts, start the Managed Servers.

    For example,

    cd ORACLE_HOME/user_projects/domains/base_domain/bin./startManagedWebLogic.sh ManagedServer_2 http://<adminServerHost>:7001
    

36.4.3 How to Create a JDBC Data Source for Oracle WebLogic Server

Oracle ADF applications can use either a JDBC data source or a JDBC URL for database connections. You use the Oracle WebLogic Server Administration Console to configure a JDBC data source. For more information about database access, see Chapter 9, "Configuring Your Application Module Database Connection."

The ADF application module in the data model project can be configured to use a JDBC URL connection type, a JDBC data source connection type, or a combination of both types. By default, ADF application modules use a JDBC URL connection. A component that uses a JDBC URL will attempt to connect directly to the database using the JDBC URL, and it will ignore any JDBC data sources (global or application-level) that are available in WebLogic Server. For more information about migrating JDBC URL security information (user names and passwords) from the application to WebLogic Server, see Section 36.3.4, "How to Deploy Applications with ADF Security Enabled."

An ADF application can use a JDBC data source to connect to the database. A JDBC data source has three types: global, application level, and application level with password indirection. You generally set up a global JDBC data source in WebLogic Server. Any application that requires access to that database can use that JDBC data source. An application can also include application-level JDBC data sources. When the application is packaged for deployment, if the Auto Generate and Synchronize weblogic-jdbc.xml Descriptor During Deployment option is selected, JDeveloper creates a connection_name-jdbc.xml file for each connection that was defined. Each connection's information is written to the corresponding connection_name-jdbc.xml file (entries are also changed in weblogic-application.xml and web.xml). When the application is deployed to WebLogic Server, the server looks for application-level data source information before it looks for the global data source.

If the application is deployed with password indirection set to true, WebLogic Server will look for the connection_name-jdbc.xml file for user name information and it will then attempt to locate application-level credential maps for these user names to obtain the password. If you are using JDeveloper to directly deploy the application to WebLogic Server, JDeveloper automatically creates the credential map and populates the map to the server using an MBean call.

However, if you are deploying to an EAR file, JDeveloper will not be able to make the MBean call to WebLogic Server. You must set up the credential maps using the Oracle WebLogic Administration Console. Even if you have a global JDBC data source set up, if you do not also have credential mapping set up, WebLogic Server will not be able to map the credentials with passwords and the connection will fail. For more information about JDBC data sources, password indirection, and how to set up application credential mappings, see "JDBC Data Sources" in the "Deploying Applications" section of the JDeveloper online help.

To configure Oracle WebLogic Server for a JDBC data source:

  1. Start Oracle WebLogic Server (if not already started) by choosing Oracle Fusion Middleware > User Projects > Domain > Start Admin Server for WebLogic Server Domain from the Windows Start menu.

    For Linux, log in as the root user and navigate to:

    <ORACLE_HOME>/user_projects/domains/MYSOADomain/bin
    

    Run the following command:

    ./startWebLogic.sh
    

    Or, from the Application Server Navigator, right-click an Oracle WebLogic Server instance and choose Launch Admin Console.

  2. Start the Oracle WebLogic Server Administration Console by choosing Oracle Fusion Middleware > User Projects > Domain > Admin Server Console from the Windows Start menu.

  3. Log in to the Oracle WebLogic Server Administration Console.

  4. In the WebLogic Server Administration Console page, select JDBC > Data Sources.

  5. Click New.

  6. In the JDBC Data Source Properties page:

    • In the Name field, enter the name of the JDBC data source.

    • In the JNDI field, enter the name of the connection in the form jdbc/connection DS.

    • For the Database Type, select Oracle.

    • For the Database Driver, select Oracle Driver (thin), and click Next.

  7. In the Transactions Options page, accept the default options and click Next.

  8. In the Connection Properties page:

    • For Database Name, enter the Oracle SID. For example, orcl.

    • For Host Name, enter the machine name of the database.

    • Enter the port number used to access the database.

    • Enter the user name and password for the database and click Next.

  9. In the Test Database Connection page, click Test Configuration to test the connection.

  10. In the Select Targets page, select the server for which the JDBC data source is to be deployed.

  11. Click Finish.

Once the data source has been created in Oracle WebLogic Server, it can be used by an application module.

36.5 Deploying the Application

Before you begin to deploy the application to your target application server, you may need to perform some vendor-specific configuration. See your application server documentation for instructions.

You can deploy directly to Oracle WebLogic Server if you have set up a connection in JDeveloper to Oracle WebLogic Server.

Note:

When you are deploying to Oracle WebLogic Server from JDeveloper, ensure that the HTTP Tunneling property is enabled in the Oracle WebLogic Server Administration Console. This property is located under Servers > ServerName > Protocols. ServerName refers to the name of Oracle WebLogic Server.

Before you begin to deploy applications that use Oracle ADF to Oracle WebLogic Server, you need to install the ADF runtime on the server. For more information, see Section 36.4.1, "How to Install the ADF Runtime to the WebLogic Server Installation."

Note:

If your ADF application has business services that you want to deploy to WebLogic Server, see Section 11.2.19, "How to Deploy Web Services to Oracle WebLogic Server."

Any necessary MDS repositories must be registered with the WebLogic Administration Server. If the MDS repository is a database, the repository maps to an Oracle WebLogic system data source with MDS-specific requirements. Before you deploy the application, make sure to target this data source to the WebLogic Administration Server and to all Managed Servers to which you are deploying the application. For more information about registering MDS, see the Oracle Fusion Middleware Administrator's Guide.

If you are using the Oracle WebLogic Server Administrative Console or WLST scripts to deploy an application packaged as an EAR file that requires MDS repository configuration in adf-config.xml, you must run the getMDSArchiveConfig WLST command to configure MDS before deploying the EAR file. MDS configuration is required if the EAR file contains a MAR file or if the application is enabled for DT@RT (Design Time At Run Time). For more information about WLST commands, see the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

If you plan to configure ADF connection information, ADF Business Components information, or adf-config.xml using ADF MBeans after the application has been deployed, make sure that the application is configured with MDS and have the MBean listeners enabled in the web.xml file. For more information, see Section 36.3.6, "How to Enable the Application for ADF MBeans."

For more information about registering MDS, see the Oracle Fusion Middleware Administrator's Guide.

Table 36-1 describes some common deployment techniques that you can use during the application development and deployment cycle. The deployment techniques are listed in order from deploying on development environments to deploying on production environments. It is likely that in the production environment, the system administrators deploy applications by using Enterprise Manager or the WLST scripting tool.

Table 36-1 Deployment Techniques for Development or Production Environments

Deployment Technique Environment When to Use

Run directly from JDeveloper

Test or Development

When you are developing your application. You want deployment to be quick because you will be repeating the editing and deploying process many times.

JDeveloper contains Integrated WebLogic Server, on which you can run and test your application.

Use JDeveloper to directly deploy to the target application server

Test or Development

When you are ready to deploy and test your application on an application server in a test environment.

On the test server, you can test features (such as LDAP and Oracle Single Sign-On) that are not available on the development server.

You can also use the test environment to develop your deployment scripts, for example, using Ant.

Use JDeveloper to deploy to EAR file, then use the target application server's tools for deployment

Test or Development

When you are ready to deploy and test your application on an application server in a test environment. As an alternative to deploying directly from JDeveloper, you can deploy to an EAR file. and then use other tools to deploy to the application server.

On the test server, you can test features (such as LDAP and Oracle Single Sign-On) that are not available on the development server.

You can also use the test environment to develop your deployment scripts, for example, using Ant.

Use Enterprise Manager or WLST script to deploy applications

Production

When your application is in a test and production environment. In production environments, system administrators usually use Enterprise Manager or run WLST scripts to deploy applications.


36.5.1 How to Deploy to WebLogic Server from JDeveloper

Before you begin:

Create an application-level deployment profile that deploys to an EAR file.

Note:

JDeveloper does not support deploying applications to individual Managed Servers that are members of a cluster. You may be able to target one or more Managed Servers within a cluster using the Oracle WebLogic Server Administration Console or other Oracle WebLogic tools; however, the cluster can be negatively affected. For more information about deploying to Oracle WebLogic Server clusters, see the Oracle Fusion Middleware Administrator's Guide.

To deploy to the target application server from JDeveloper:

  1. In the Application Navigator, right-click the application and choose Deploy > deployment profile.

  2. In the Deploy wizard Deployment Action page, select Deploy to Application Server and click Next.

  3. In the Select Server page, select the application server connection.

  4. Click Finish.

    During deployment, you can see the process steps displayed in the deployment Log window. You can inspect the contents of the modules (archives or exploded EAR) being created by clicking on the links that are provided in the log window. The archive or exploded EAR file will open in the appropriate editor or directory window for inspection.

    If the adf-config.xml file in the EAR file requires MDS repository configuration, the Deployment Configuration dialog appears for you to choose the target metadata repository or shared metadata repositories, as shown in Figure 36-3. The Repository Name dropdown list allows you to choose a target metadata repository from a list of metadata repositories registered with the Administration Server. The Partition Name dropdown list allows you to choose the metadata repository partition to which the application's metadata will be imported during deployment. You can use WLST commands or the Oracle WebLogic Server Administration Tool to configure and register MDS. For more information about managing the MDS Repository, see the Oracle Fusion Middleware Administrator's Guide.

    Figure 36-3 MDS Configuration and Customization for Deployment

    MDS configuration

    Note:

    If you are deploying a Java EE application, click the application menu next to the Java EE application in the Application Navigator.

    For more information on creating application server connections, see Section 36.3.1, "How to Create a Connection to the Target Application Server."

    Tip:

    You may get an exception in JDeveloper when trying to deploy large EAR files. The workaround is to deploy the application using the Oracle WebLogic Server Administration Console.

36.5.2 How to Create an EAR File for Deployment

You can also use the deployment profile to create an archive file (EAR file). You can then deploy the archive file using Enterprise Manager, WLST scripts, or Oracle WebLogic Server Administration Console.

Although an ADF application is encapsulated in an EAR file (which usually includes WAR, MAR, and JAR components), it may have parts that are not deployed with the EAR. For instance, ADF Business Services can be deployed as a JAR. For more information about business services, see Section 11.2.19, "How to Deploy Web Services to Oracle WebLogic Server."

To create an EAR archive file:

  • In the Application Navigator, right-click the application containing the deployment profile, and choose Deploy > deployment profile > to EAR file.

    If an EAR file is deployed at the application level, and it has dependencies on a JAR file in the data model project and dependencies on a WAR file in the view-controller project, then the files will be located in the following directories by default:

    • ApplicationDirectory/deploy/EARdeploymentprofile.EAR

    • ApplicationDirectory/ModelProject/deploy/JARdeploymentprofile.JAR

    • ApplicationDirectory/ViewControllerProject/deploy/WARdeploymentprofile.WAR

Tip:

Choose View >Log to see messages generated during creation of the archive file.

36.5.3 What You May Need to Know About ADF Libraries

An ADF Library is a JAR file that contains JAR services registered for ADF components such as ADF task flows, pages, or application modules. If you want the ADF components in a project to be reusable, you create an ADF Library deployment profile for the project and then create an ADF Library JAR based on that profile.

An application or project can consume the ADF Library JAR when you add it using the Resource Palette or manually by adding it to the library classpath. When the ADF Library JAR is added to a project, it will be included in the project's WAR file if the Deployed by Default option is selected.

For more information, see Chapter 33, "Reusing Application Components."

36.5.4 What You May Need to Know About EAR Files and Packaging

When you package an ADF application into an EAR file, it can contain the following:

  • WAR files: Each web-based view controller project should be packaged into a WAR file.

  • MAR file: If the application has customizations that are deployed with the application, it should be packaged into a MAR.

  • ADF Library JAR files: If the application consumes ADF Library JARs, these JAR files may be packaged within the EAR.

  • Other JAR files: The application may have other dependent JAR files that are required. They can be packaged within the EAR.

36.5.5 How to Deploy the Application Using Scripts and Ant

You can deploy the application using commands and automate the process by putting those commands in scripts. The ojdeploy command can be used to deploy an application without JDeveloper. You can also use Ant scripts to deploy the application. JDeveloper has a feature to help you build Ant scripts. Depending on your requirements, you may be able to integrate regular scripts with Ant scripts.

For more information about commands, scripts, and Ant, see the Oracle Fusion Middleware Administrator's Guide for Oracle Application Development Framework.

36.5.6 What You May Need to Know About JDeveloper Runtime Libraries

When an application is deployed, it includes some of its required libraries with the application. The application may also require shared libraries that have already been loaded to WebLogic Server as JDeveloper runtime libraries. It may be useful to know which JDeveloper libraries are packaged within which WebLogic Server shared library. For a listing of the contents of the JDeveloper runtime libraries, see the Oracle Fusion Middleware Administrator's Guide for Oracle Application Development Framework.

36.6 Postdeployment Configuration

After you have deployed your application to WebLogic Server, you can perform configuration tasks.

36.6.1 How to Migrate an Application

If you want to migrate an ADF application from one WebLogic Server to another WebLogic Server, you may need to perform some of the same steps you did for a first time deployment.

In general, to migrate an application, you would:

36.6.2 How to Configure the Application Using ADF MBeans

If ADF MBeans were enabled and packaged with the deployed application, you can configure ADF properties using the Enterprise Manager MBean Browser. For instructions to enable an application for MBeans, see Section 36.3.6, "How to Enable the Application for ADF MBeans."

For information on how to configure ADF applications using ADF MBeans, see the Oracle Fusion Middleware Administrator's Guide for Oracle Application Development Framework.

36.7 Testing the Application and Verifying Deployment

After you deploy the application, you can test it from Oracle WebLogic Server. To test-run your ADF application, open a browser window and enter a URL:

  • For non-Faces pages: http://<host>:port/<context root>/<page>

  • For Faces pages: http://<host>:port/<context root>/faces/<view_id>

    where <view_id> is the view ID of the ADF task flow view activity.

Tip:

The context root for an application is specified in the view-controller project settings by default as ApplicationName/ProjectName/context-root. You can shorten this name by specifying a name that is unique across the target application server. Right-click the view-controller project, and choose Project Properties. In the Project Properties dialog, select Java EE Application and enter a unique name for the context root.

Note:

/faces has to be in the URL for Faces pages. This is because JDeveloper configures your web.xml file to use the URL pattern of /faces in order to be associated with the Faces Servlet. The Faces Servlet does its per-request processing, strips out /faces part in the URL, then forwards the URL to the JSP. If you do not include the /faces in the URL, then the Faces Servlet is not engaged (since the URL pattern doesn't match). Your JSP is run without the necessary JSF per-request processing.