Skip Headers
Oracle® Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework
11g Release 1 (11.1.1)
B31974-03
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
 
Next
Next
 

35 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:

35.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 the Integrated WLS Server.


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 Servers. JDeveloper supports deploying to Oracle WebLogic Server clusters. You cannot use JDeveloper to deploy to individual Oracle WebLogic Managed Servers within a cluster.

For more information about deployment to development or production environments, see Section 35.9, "Deploying the Application".


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:

You can use JDeveloper to:

If you are developing an application in JDeveloper and want to run the application in the Integrated WLS, 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 the Integrated WLS and does not require any deployment profiles or descriptors. The Integrated WLS also has access to the ADF libraries required to run an Oracle ADF application. You can run an application by selecting Run from the JDeveloper menu. You debug the application using the features described in Chapter 30, "Testing and Debugging ADF Components".

In general (other than Integrated WLS), you use JDeveloper to prepare the application or project for deployment by:

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

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

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

35.2 Creating 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 Name and Type page of the Create AppServer Connection dialog, enter a connection name.

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

  4. Click Next.

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

  6. Click Next.

  7. On the Configuration page, enter an Oracle WebLogic host name.

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

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

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

  9. In the SSL Port field, enter an SSL port number for the Oracle WebLogic Server 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.

  10. Select Always use SSL to connect to the Oracle WebLogic Server using the SSL port.

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

  12. Click Next.

  13. 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.

  14. Click Finish.

35.3 Creating a Deployment Profile

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

You should create 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 should create an application-level metadata archive (MAR) deployment profile as well. For more information about seeded customizations, see Chapter 33, "Customizing Applications with MDS". If the application has customization classes, you should create a JAR file for those classes and add that JAR when you create the EAR file. Finally, you create an application-level EAR deployment profile and select the projects you want to include from a list, such as WAR and MAR profiles and customization classes JAR file. When the application is deployed, the EAR file will include all the projects that were selected in the deployment profile.

For Oracle ADF applications, you can only deploy the application 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.

35.3.1 How to Add 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, you should make sure 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 model project that you want to create a customization classes JAR and choose New.

  2. In the New Gallery, expand General and select Deployment Profiles.

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

  3. In the Items list, choose JAR File and click OK.

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

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

  6. Enter the location you want to put the JAR file.

  7. Expand Files Groups > Project Output > Filters.

  8. 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 classloader 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.

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

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

35.3.2 How to Create Deployment Profiles

Before you create the project and application deployment profiles for an application with customization classes, you should already have added those classes into a JAR file, as described in Section 35.3.1, "How to Add Customization Classes into a JAR.".

To create 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 and select Deployment Profiles.

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

  3. In the Items list, choose WAR File and click OK.

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

  5. 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 classloader 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.


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

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

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

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

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

  10. In the New Gallery, expand General and select Deployment Profiles.

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


    Note:

    Perform Steps 9 to 14 only if you want to deploy metadata using the MAR deployment profile.

  11. In the Items list, choose MAR File and click OK.

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

  13. In the Edit MAR 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, as shown in Figure 35-1.

    Figure 35-1 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.

    • 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.

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

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

    You will create a EAR profile for the application.

  16. In the New Gallery, expand General and choose Deployment Profiles.

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

  17. In the Items list, choose EAR File and click OK.

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

  19. 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 they load from the EAR-level application classloader. 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 35.3.1, "How to Add 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.

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

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

35.3.3 How to View and Change 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.

35.4 Creating and Editing 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 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 the application EAR file includes a weblogic-application.xml file that contains a reference to adf.oracle.domain. It should have a <library-ref> entry as shown in Example 35-1.

Example 35-1 library-ref tag in weblogic-application.xml

<library-ref>
    <library-name>adf.oracle.domain</library-name>
</library-ref>

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.

35.4.1 How to Create Deployment Descriptors

Before you begin, you should 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 and choose Deployment Descriptors.

  3. In the Items list, choose 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 may have only one instance of a descriptor.

    JDeveloper starts the Create Deployment Descriptor wizard or opens the file in the 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.


35.4.2 How to View or Change 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, right-click the deployment descriptor and choose Properties.

    The Properties dialog that appears depends on the selected descriptor type.

    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 the source editor.

  2. In the Properties dialog, choose 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.

  3. Click OK.

35.4.3 How to Create or Configure 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 create 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.

35.4.4 How to Create or Configure 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).


Note:

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

To create 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.

35.4.5 How to Create Deployment Descriptors for Applications with ADF Faces Components

If your application uses ADF Faces components, ensure that the standard Java EE 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.

If you are using ADF databound UI components as described in Section 12.3, "Using the Data Controls Panel", ensure that you have the DataBindings.cpx file. For information about this file, see Section 12.4, "Working with the DataBindings.cpx File".

35.5 Deploying Applications with Security Credentials, Identities, and Policies

In a development environment, JDeveloper will automatically migrate application-level credentials, identities, and policies to the remote WebLogic Server only if the server is set up to be in development mode. The 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 Understanding Domain Configuration for Oracle WebLogic Server.

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 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 more information about migrating application credentials and other jazn-data user credentials, see the Oracle Fusion Middleware Security Guide.

If you are developing an application in JDeveloper using the Integrated WLS, application security deployment properties are configured by default so 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 29.8.1, "How to Configure, Deploy, and Run a Secure Application in JDeveloper".

35.6 Installing the ADF Runtime to the WebLogic Installation

The 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 the Integrated Oracle WebLogic Server.

You can install the ADF runtime using the following installers:

If you installed the Oracle WebLogic Server together with JDeveloper 11g using the Oracle 11g Installer (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 35.7, "Creating and Extending Oracle WebLogic Server Domains".

35.6.1 How to Install the ADF Runtime into an Existing WebLogic Server 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, you must already have installed an 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 35.7, "Creating and Extending Oracle WebLogic Server Domains" to use the Oracle Fusion Middleware Configuration Wizard to create or extend an Oracle WebLogic Server domain.

35.6.2 How to Install the ADF Runtime into an Existing WebLogic Server Using the Oracle Installer

Before you add the ADF runtime into an existing Oracle WebLogic Server installation, you must have obtained the Oracle 11g Installer. 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 JDeveloper 11g Installation Guide 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 as described in the Oracle JDeveloper 11g Installation Guide.

  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.

    The 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 JDeveloper 11g Installation Guide to complete the installation.

  5. When the installation is complete, click Done.

    Follow the instructions in Section 35.7, "Creating and Extending Oracle WebLogic Server Domains" to use the Oracle Fusion Middleware Configuration Wizard to extend an Oracle WebLogic Server domain.

35.6.3 What You May Need to Know About ADF Libraries

A JAR file is an ADF Library if it contains JAR services registered for ADF components such as ADF task flows, pages, or application modules. If the JAR file contains these components, the ADF Library provides summary information that can be browsed in the Resource Palette. For more information, see Chapter 32, "Reusing Application Components".

35.7 Creating and Extending Oracle WebLogic Server Domains

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

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

If you are setting up Oracle WebLogic Managed Servers for Oracle ADF where the Managed Servers are on the same host as the WebLogic 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 WebLogic Administration Server, perform the additional steps described in Section 35.7.3, "How to Set Up Remote Oracle WebLogic Managed Servers for ADF".

35.7.1 How to Create 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, 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 WLSHOME/wlserver_10.3/common/bin/config.exe 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, select 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 Enterprise Manager and Oracle JRF 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 Advanced 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.

35.7.2 How to Extend an Oracle WebLogic Server Domain for Oracle ADF

Before you begin to extend an Oracle WebLogic Server domain for ADF application deployment, you must already have an existing domain and must have 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, 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 WLSHOME/wlserver_10.3/common/bin/config.exe 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, select 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 Enterprise Manager and Oracle JRF 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.

  8. After you have extended the domain, check the POST_CLASSPATH entry to make sure that setDomainEnv is set to the correct location.

    The correct location should be ORACLE_HOME\jdeveloper\modules\features\adf.share_11.1.1.jar.

    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 the Oracle WebLogic Server by running the command-line script ORACLE_HOME\user_projects\domains\domain_name\bin\startWebLogic.cmd and stop the server using the stopWebLogic.cmd script in the same directory.

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

35.7.3 How to Set Up Remote Oracle WebLogic Managed Servers for ADF

If you are enabling Oracle WebLogic Managed Servers for ADF application deployment that are on a different host than the Oracle WebLogic 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 Oracle WebLogic managed servers for ADF:

  1. Use the Oracle Installer to install Oracle WebLogic Servers 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 Servers, use the Oracle Installer to install the ADF runtime into the WebLogic Servers on both hosts by selecting the Application Development Framework Runtime option. For more information on installation, see Section 35.6.2, "How to Install the ADF Runtime into an Existing WebLogic Server Using the Oracle Installer".

  2. Run the Oracle Fusion Middleware Configuration Wizard to create a new Oracle WebLogic Server domain. In the wizard, select the JRF option as described in Section 35.7.1, "How to Create 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 instance,

    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 instance,

    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 instance,

    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 instance,

    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 instance,

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

35.8 Creating a JDBC Data Source for an Oracle WebLogic Server

Oracle ADF applications can use either a JDBC data source or JDBC URL for database connections. You use the Oracle WebLogic Server Administration Console to configure a JDBC data source.

To configure an Oracle WebLogic server for JDBC data source and JDBC URL:

  1. Start the 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.

  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 on the Oracle WebLogic server, it can be used by an application module.

35.9 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 your 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 your 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 35.6, "Installing the ADF Runtime to the WebLogic Installation".


Note:

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. For more information about WLST commands, see the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.


Table 35-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 the Enterprise Manager or the WLST scripting tool.

Table 35-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 WLS, on which you can run and test your application. You should also deploy your application to an external application server to test it.

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. 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.


35.9.1 How to Deploy to a WebLogic Server from JDeveloper

Before you begin to deploy an application or project, you should have already created an application-level deployment profile that deploys to an EAR file.


Note:

JDeveloper only supports deploying applications to the Oracle WebLogic Server cluster. You cannot use JDeveloper to deploy to individual Managed Servers within a cluster. You may be able to target one or more Managed Servers within a cluster using 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:

  • To deploy an application, in the Application Navigator, right-click the application and choose Deploy > deployment profile > to > application server connection.

    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 35-2. The Repository Name dropdown list allows you to choose a target metadata repository from a list of metadata repositories registered with the Oracle WebLogic 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. For more information about managing the MDS Repository, see the Oracle Fusion Middleware Administrator's Guide.

    Figure 35-2 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 35.2, "Creating 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.

35.9.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.

Note that you can only deploy an Oracle ADF application as an EAR file. WAR and MAR files associated with the application must be embedded in the EAR file.

To create an archive file:

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

For Java EE applications, create an EAR deployment profile from the application context menu and assemble the projects, which typically represent Java EE modules, into your application archive.


Tip:

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

35.9.3 How to Deploy an Application Using Ant

You can deploy to most application servers from JDeveloper, or you can use tools provided by the application server vendor. You can also use Ant to package and deploy applications. The build.xml file, which contains the deployment commands for Ant, may vary depending on the target application server.

For deployment to other application servers, see the application server's documentation. If your application server does not provide specific Ant tasks, you may be able to use generic Ant tasks. For example, the generic ear task creates an EAR file for you.

For information about Ant, see http://ant.apache.org.

35.9.4 How to Deploy a MAR Deployment Profile to the Integrated WLS

When an application is running in the Integrated WLS, 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 their locations in source control.

Any customizations or documents created by the application are written to this simulated MDS repository directory. You can keep the default location for this directory, or you can set it to a different directory. You also have the option to preserve customizations across different application runs, or to delete the customizations before each application run.

Before you begin, you should already have created a MAR profile.

To deploy the MAR profile to the Integrated WLS:

  1. In the Application Navigator, right-click the application and select 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, as shown in Figure 35-3.

    Figure 35-3 Setting the Run MDS options

    Application roperties Run MDS options

35.10 Testing the Application and Verifying Deployment

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


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.