2 Deploying ADF Applications

This chapter describes how to deploy Oracle ADF applications packaged as an EAR file to a target application server for production and later stage testing. It describes how to prepare the application server for deployment by installing the ADF runtime. It also describes some of the tools that can be used for deployment including Oracle Enterprise Manager Fusion Middleware Control, scripts, and Ant.

This chapter includes the following sections:

For information about deploying ADF applications for development, see the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

For deploying to third-party application servers, such as IBM WebSphere Application Server, see the Oracle Fusion Middleware Third-Party Application Server Guide.

2.1 Introduction to Deploying ADF Applications

Deployment is the process of packaging application files and artifacts and transferring them to a target application server to be run. During application development using JDeveloper, developers can test the application using the Integrated WebLogic Server that is built into the JDeveloper installation, or they can use JDeveloper to directly deploy to a standalone application server.

After the application has been developed, administrators can deploy the application to production application servers. The tools that the administrators use for production-level deployment are:

  • Oracle Enterprise Manager Fusion Middleware Control

  • WebLogic Scripting Tool (WLST) commands or WebSphere Application Server (wsadmin) commands

  • Command scripts and Ant scripts

  • Oracle WebLogic Administration Console or IBM WebSphere Administrative Console

This chapter describes the tools and methods that administrators use to deploy ADF applications. For information about deploying ADF applications for development and testing purposes using JDeveloper, see the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

If your application uses customization, you may need to set up the MDS repository in the application server. For more information about MDS, see the Oracle Fusion Middleware Administrator's Guide.

Note:

Developers, Test, and QA personnel may also use these tools and the methods in this chapter to deploy ADF applications to staging application servers.

2.2 Preparing the Standalone Application Server for Deployment

To run ADF applications, you must install the standalone application server with the ADF runtime. You can include the ADF runtime during a new application server installation or you can install the ADF runtime into an existing application server installation.

Figure 2-1 shows the flow diagram for preparing a standalone application server for deployment. Note the following definitions used in the diagram:

  • OWSM: Oracle Web Services Manager

  • JRF: Java Required Files

  • RCU: Repository Creation Utility

  • MDS: Metadata Store

The following diagram contains clickable links.

Figure 2-1 Preparing the Application Server Flow Diagram

Preparing the Application Server Flow Diagram Install ADF runtime for WebLogic Server Install ADF runtime for WebSphere Application Server Install patches and software updates for WebSphere Application Server Create a global JDBC Source Create WebLogic Server domain Create WebLogic Server domain
Description of "Figure 2-1 Preparing the Application Server Flow Diagram"

For WebLogic Server, the following points apply:

  • After WebLogic Server has the ADF runtime installed, you can create a new WebLogic Server 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.

  • For additional information about the tools available (such as OPatch) for patching your existing Oracle Fusion Middleware environment or upgrading your existing IBM WebSphere Application Server environment, see the Oracle Fusion Middleware Patching Guide.

  • For additional information about creating and loading the schemas that are necessary for many of the Oracle Fusion Middleware components, see the Oracle Fusion Middleware Repository Creation Utility User's Guide.

  • For the latest information about Oracle Application Development Framework and Oracle JDeveloper, see the Oracle JDeveloper Release Notes on Oracle Technology Network.

For WebSphere Application Server, the following points apply:

  • For general information about using IBM WebSphere Application Server with Oracle Fusion Middleware and installation and configuration procedures, see the Oracle Fusion Middleware Third-Party Application Server Guide.

  • After WebSphere Application Server has the ADF runtime installed, you can create a new WebSphere cell or you can extend an existing WebSphere cell for ADF.

  • For additional information about using the Oracle Fusion Middleware Configuration Wizard to configure WebSphere and the WebSphere cell environment, see the Oracle Fusion Middleware Configuration Guide for IBM WebSphere Application Server.

  • For additional information about the tools available (such as OPatch) for patching your existing Oracle Fusion Middleware environment or upgrading your existing WebSphere Application Server environment, see the Oracle Fusion Middleware Patching Guide.

  • For additional information about creating and loading the schemas that are necessary for many of the Oracle Fusion Middleware components, see the Oracle Fusion Middleware Repository Creation Utility User's Guide.

  • If the servers are on a different node than the Deployment Manager, you must perform additional configuration tasks for the 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 WebSphere Application Server with the data source using the WebSphere Administrative Console.

  • For the latest information about Oracle Application Development Framework and Oracle JDeveloper, see the Oracle JDeveloper Release Notes on Oracle Technology Network.

2.2.1 How to Install the ADF Runtime to the Application Server Installation

The application server requires the ADF runtime to run ADF applications.

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

For WebLogic Server, you can install the ADF runtime using the following installers:

  • 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 Portal components). You must have already installed Oracle WebLogic Server before you can use this installer.

    Note:

    The Oracle 11g Installer for JDeveloper can also be used to install the ADF runtime to the application server installation. However, it does not include all the components that are typically needed for production and full test environments. Therefore, this installer should not be used for anything other than for development purposes.

For WebSphere Application Server, you can install the ADF runtime using the following installer:

  • Oracle Fusion Middleware 11g Application Developer Installer: Installs the ADF runtime and Oracle Enterprise Manager. You must have already installed WebSphere Application Server before you can use this installer. For more information, see the Oracle Fusion Middleware Third-Party Application Server Guide.

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

Install Oracle WebLogic Server. You must also have obtained the Oracle Fusion Middleware 11g Application Developer Installer.

Use the instructions in the Oracle Fusion Middleware Installation Planning Guide to obtain the software and start the installer,

In the installer you will perform several tasks including:

  • Adding any software updates

  • Selecting the WebLogic Server directory for installation

  • Verifying installation information

After you have installed the ADF runtime, follow the instructions in Section 2.2.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.

2.2.1.2 Installing the ADF Runtime into an Existing WebSphere Application 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, you must already have a WebSphere Application Server installation.

Use the instructions in the Oracle Fusion Middleware Third-Party Application Server Guide to obtain the software and start the installer.

In the installer you will perform several tasks including:

  • Adding any software updates

  • Selecting the WebSphere directory for installation

  • Verifying installation information

2.2.2 How to Create and Extend Oracle WebLogic Server Domains

You need to create and configure the Oracle WebLogic Server domain to accept 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 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 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 2.2.2.3, "Setting Up Remote WebLogic Managed Servers for Oracle ADF."

2.2.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 as described in the "Configuring Application Developer" chapter of the Oracle Fusion Installation Guide for Application Developer.

    Follow the directions as described in that guide but consider the following steps.

  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.

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

    Select Oracle JRF. If you are using Oracle Web Services, select Oracle WSM Policy Manager and click Next.

2.2.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 ADF:

  1. Start the Oracle Fusion Middleware Configuration wizard as described in the "Configuring Application Developer" chapter of the Oracle Fusion Installation Guide for Application Developer.

    Follow the directions as described in that guide but consider the following steps.

  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.

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

    Select Oracle JRF. If you are using Oracle Web Services, select Oracle WSM Policy Manager and click Next.

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.

2.2.2.3 Setting Up Remote WebLogic Managed Servers for Oracle ADF

If the WebLogic Managed Servers 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 Oracle 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 2.2.1, "How to Install the ADF Runtime to the Application 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 2.2.2.1, "Creating an Oracle WebLogic Server Domain for Oracle ADF."

  3. On the local host, 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/oracle_common/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/oracle_common/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
    

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

Use the Oracle WebLogic Server Administration Console to set up a JDBC data source in the WebLogic Server instance for your applications.

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.

2.2.4 How to Create a JDBC Data Source for IBM WebSphere Application Server

To configure a JDBC data source for WebSphere Application Server, see the Oracle Fusion Middleware Configuration Guide for IBM WebSphere Application Server.

2.3 Deploying Using Oracle Enterprise Manager Fusion Middleware Control

You can use Oracle Enterprise Manager Fusion Middleware Control to deploy the EAR file created in JDeveloper. Fusion Middleware Control is a Web browser-based, graphical user interface that you can use to monitor and administer a farm. For more information about deploying using Fusion Middleware Control, see the Oracle Fusion Middleware Administrator's Guide.

2.4 Deploying Using Scripting Commands

Applications or modules can be deployed from JDeveloper without starting the JDeveloper IDE. You can run WLST commands (for WebLogic Server) or wsadmin commands (for WebSphere Application Server) from the command line or sequence them in scripts to run as a batch.

Before deploying from the command line, there must be deployment profiles for the application (EAR) or project (JAR or WAR). JDeveloper creates these deployment profiles automatically for certain types of applications, but before using commands for deployment, it is important to verify that the deployment profile(s) exist. To verify that the profiles exist, choose the Deployment node from either the Application Properties or Project Properties dialogs in JDeveloper. For more information about deployment profiles, see the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

JDeveloper can also be used to deploy an application's EAR, WAR, or JAR files. The same scripts that are used for deployment via a command line are also used to deploy via JDeveloper, but JDeveloper creates the syntax and provides a user interface for the deployment.

There are specific WLST commands (WebLogic) for working with ADF applications. For a list of these commands, see Chapter 5, "WLST Command Reference for ADF Applications."

For more information about using WLST scripts, see the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

There are specific wsadmin commands (WebSphere Application Server) for working with ADF applications. For a list of these commands, see Appendix B, "wsadmin Command Reference for ADF Applications."

2.5 Deploying Using Scripts and Ant

You can deploy the application using commands and scripts. You create a script to deploy the application using the ojdeploy command and use the ojaudit command to audit projects, workspaces, or source files of the application. You can also set up the script to run automatically, for instance, whenever a developer checks in new changes.

ojdeploy scripts and Ant scripts can be used together or separately:

  1. Create an ojdeploy script to compile, package, and deploy the application.

  2. Create an ojdeploy script to compile and package the application. Then use an Ant script (such as WLDeploy) to deploy the application.

  3. Create an Ant script to compile, package, and deploy the application. The Ant does not need to use ojdeploy.

For more information about the ojdeploy and ojaudit commands, see the JDeveloper online help.

You can deploy to most application servers from JDeveloper, or use tools provided by the application server vendor. You may 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.

2.6 Deploying Using the Application Server Administration Tool

For WebLogic, you can use the Oracle WebLogic Server Administration Console to deploy the EAR file created in JDeveloper. For more information, see Oracle Fusion Middleware Deploying Applications to Oracle WebLogic Server.

For WebSphere Application Server, you can use the IBM WebSphere Administrative Console to deploy the EAR file created in JDeveloper. For more information, go to the WebSphere Application Server Information Center at: http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.home.doc/welcome.html.