4 Deploying Applications

Deployment is the process of packaging application files as an archive file and transferring them to a target application server. This chapter describes how to deploy Java EE applications to Oracle Fusion Middleware.

It contains the following topics:

4.1 Overview of Deploying Applications

Oracle WebLogic Server provides a Java EE-compliant infrastructure for deploying, undeploying, and redeploying Java EE-compliant applications and modules.

You can deploy the following into Oracle WebLogic Server:

  • A complete Java EE application packaged as an Enterprise Archive (EAR) file.

  • Standalone modules packaged as Java Archive files (JARs) containing Web Services, Enterprise JavaBeans (EJBs), application clients (CARs), or resource adapters (RARs).

  • An ADF application. Oracle Application Development Framework (Oracle ADF) is an end-to-end application framework that builds on Java Platform, Enterprise Edition (Java EE) standards and open-source technologies to simplify and accelerate implementing service-oriented applications.

  • An Oracle SOA Suite composite application. A SOA composite application is a single unit of deployment that greatly simplifies the management and lifecycle of SOA applications.

  • An Oracle WebCenter application. WebCenter applications differ from traditional Java EE applications in that they support run-time customization, including the application's pages, the portlets contained within these pages, and document libraries.

A Metadata Archive (MAR) is a compressed archive of selected metadata, such as the application-level deployment profile, for an application. A MAR is used to deploy metadata content to the metadata service (MDS) repository. The following application types use a MAR as a container for content that is deployed to the MDS repository: ADF applications, SOA composite applications, and Oracle WebCenter applications.

You can use Fusion Middleware Control, Oracle WebLogic Server Administration Console, Oracle JDeveloper, or the command line to deploy, undeploy, or redeploy an application. Which method you use depends on the type of application, as described in Table 4-1. This chapter describes how to deploy an application using Fusion Middleware Control.

Table 4-1 Tools to Deploy Applications

Type of Application Tools to Use

Pure Java EE application

Oracle WebLogic Server Administration Console

Fusion Middleware Control: Deployment Wizard

Oracle JDeveloper

WLST command line

ADF application

Fusion Middleware Control: Deployment Wizard

Oracle JDeveloper

WLST command line

SOA Composite application

Fusion Middleware Control: SOA Composite Deployment Wizard

Oracle JDeveloper

WLST command line

WebCenter application

Fusion Middleware Control: Deployment Wizard

Oracle JDeveloper

WLST command line


4.2 Understanding Data Sources

A data source is a Java object that application components use to obtain connections to a relational database. Specific connection information, such as URL or user name and password, are set on a data source object as properties and do not need to be explicitly defined in an application's code. This abstraction allows applications to be built in a portable manner, because the application is not tied to a specific back-end database. The database can change without affecting the application code.

Applications use the Java Naming and Directory Interface (JNDI) API to access a data source object. The application uses a JNDI name that is bound to the data source object. The JNDI name is logical and can be mapped to any data source object. Like data source properties, using JNDI provides a level of abstraction, since the underlying data source object can change without any changes required in the application code. The end result is the details of accessing a database are transparent to the application.

When you configure certain Oracle Fusion Middleware components, such as Oracle SOA Suite or Oracle WebCenter, using the Oracle WebLogic Server Configuration Wizard, you specify the data source connection information. If the components use the MDS Repository, the Configuration Wizard prepends "mds-" to the data source name to indicate that the data source is a system data source used by MDS Repository.

See Also:

Oracle Fusion Middleware Creating Domains Using the Configuration Wizard for information about specifying data sources with the Configuration Wizard

To create an MDS data source, you should use Fusion Middleware Control or WLST to set the correct attributes for the data source. The MDS data source is displayed in the navigation pane in Fusion Middleware Control and in the domain structure in the Administration Console. If your application uses an MDS Repository, you must register the repository with the Oracle WebLogic Server domain before you deploy your application.

If you are using RAC or Oracle Fusion Middleware Cold Failover Cluster, you must configure multi data sources. To do so, you must use the Oracle WebLogic Server Administration Console. Note that if you create a multi data source and you add an existing MDS data source to it, the data source you added is no longer considered a valid MDS repository. The repository is not displayed in Fusion Middleware Control or Oracle WebLogic Server Administration Console. For example, the MDS repository is not listed in the Fusion Middleware Control navigation pane and is not displayed as a choice for a target metadata repository when you deploy an application.

See Also:

Oracle Fusion Middleware Configuring and Managing JDBC for Oracle WebLogic Server for more information about configuring multiple data sources

4.3 Deploying and Undeploying Java EE Applications

The following topics describe using Fusion Middleware Control to deploy, undeploy, or redeploy a Java EE application:

See Also:

Oracle Fusion Middleware Deploying Applications to Oracle WebLogic Server for information about deploying using Oracle WebLogic Server Administration Console and for more information about using the WLST command line

4.3.1 Deploying Java EE Applications

You can deploy an application to a Managed Server or a cluster. This section describes how to deploy an application to a Managed Server.

To deploy a Java EE application to a Managed Server:

  1. From the navigation pane, expand the farm, then WebLogic Domain, and then the domain.

  2. Select the server in which you want to deploy the application.

    The server home page is displayed.

  3. From the WebLogic Server menu, select Application Deployment, then Deploy.

    The Deployment Wizard, Select Archive page is displayed, as shown in the following figure:

    Description of j2ee_deploy.gif follows
    Description of the illustration j2ee_deploy.gif

  4. In the Archive or Exploded Directory section, you can select one of the following:

    • Archive is on the machine where this browser is running. Enter the location of the archive or click Browse to find the archive file.

    • Archive or exploded directory is on the server where Enterprise Manager is running. Enter the location of the archive or click Browse to find the archive file.

  5. In the Deployment Plan section, you can select one of the following:

    • Create a new deployment plan when deployment configuration is done.

    • Deployment plan is on the machine where this web browser is running. If you select this option, enter the path to the plan.

    • Deployment plan is on the server where Enterprise Manager is running. If you select this option, enter the path to the plan.

  6. Click Next.

    The Select Target page is displayed.

  7. Select the target to which you want to deploy the application. The Administration Server, Managed Servers, and clusters are listed. You can select a cluster, one or more Managed Server in the cluster, or a Managed Server that is not in a cluster. Although the Administration Server is shown in the list of targets, you should not deploy an application to it. The Administration Server is intended only for administrative applications such as the Oracle WebLogic Server Administration Console.

  8. Click Next.

    The Application Attributes page is displayed.

  9. In the Application Attributes section, for Application Name, enter the application name.

  10. In the Context Root of Web Modules section, specify the context root for your application if you have not specified it in application.xml. The context root is the URI for the web module. Each web module or EJB module that contains web services may have a context root.

  11. If the application's adf-config.xml file archive contains MDS configuration, the Target Metadata Repository section is displayed. It allows you to choose the repository and partition for this application:

    • To change the repository, click the icon next to the Repository Name. In the Metadata Repositories dialog box, select the repository and click OK.

    • To change the partition, enter the partition name in Partition Name.

  12. If the application's adf-config.xml file archive contains MDS configuration for an MDS shared repository, the Shared Metadata Repository section is displayed. It allows you to choose the repository and partition for this application.

  13. In the Distribution section, you can select one of the following:

    • Distribute and start application (servicing all requests)

    • Distribute and start application in admin mode (servicing only admin requests)

    • Distribute only

  14. Click Next.

    The Deployment Wizard, Deployment Settings page is displayed.

  15. On this page, you can perform common tasks before deploying your application or you can edit the deployment plan or save it to a disk. Depending on the type of application, you can:

    • Configure Web modules: Click Go to Task in the Configure Web Modules row. The Configure Web Modules page is displayed. Click Configure General Properties to view and edit the general configuration for the Web Module or Map Resource References to map the resource references.

      For example, you can change the session invalidation interval or the maximum age of session cookies.

    • Configure application security. Click Go to Task in the Configure Application Security row. Depending on what type of security is used, different pages are displayed.

      If the application contains jazn-data.xml or cwallet.sso, the Configure Application Security page displays the following sections:

      • If it contains jazn-data.xml, the page displays the Application Policy Migration section.

      • If it contains cwallet.sso, the page displays the Application Credential Migration section.

      • If it contains both, the page displays both sections.

      For information about these settings, see "Deploying JavaEE and ADF Applications with Oracle Enterprise Manager" in the Oracle Fusion Middleware Security Guide.

      If the application contains neither of these files, the Configure Application Security page displays the following options:

      • DD Only: Use only roles and policies that are defined in the deployment descriptors.

      • Custom Roles: Use roles that are defined in the Administration Console; use policies that are defined in the deployment descriptor.

      • Custom Roles and Policies: Use only roles and policies that are defined in the Administration Console.

      • Advanced: Use a custom model that you have configured on the realm's configuration page.

    • Configure EJB modules: Click Go to Task in the Configure EJB modules row. The Configure EJB Modules page is displayed. Click Configure EJB Properties to view and edit the general configuration for the EJBs or Map Resource References to map the resource preferences.

      For example, you can configure the maximum number of beans in the free pool or the network access point.

    • Configure ADF Connections. To modify the ADF connections, click Go to Task in the Configure ADF Connections row. The Configure ADF Connections page is displayed, showing the current connection information. To modify a connection type, click the Edit icon for a particular row. For example, to modify the connection information for an external application. For more information about ADF connections, see Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework

    For a simple Java EE application, only the first three options may be displayed.

  16. Expand Deployment Plan.

    You can edit and save the deployment plan, if you choose. If you edit the deployment plan and change descriptor values, those changes are saved to the deployment plan. In addition, the following configurations are saved to the deployment plan:

    • Application attributes

    • Web module configuration

    • EJB configuration

    Application attributes related to MDS are stored in the file adf-config.xml. Application security attributes are stored in weblogic-application.xml.

    Fusion Middleware Control updates the relevant files and repackages the .ear file.

  17. Click Deploy.

    Fusion Middleware Control displays processing messages.

  18. When the deployment is completed, click Close.

To deploy an application to multiple servers at the same time, navigate to the domain. Then, from the WebLogic Domain menu, select Application Deployment, then Deploy. The deployment wizard displays a page where you can select the servers.

To deploy an application to a cluster, select the cluster. Then, from the Cluster menu, select Application Deployment, then Deploy.

WLST Command:

deploy(app_name,path, [targets] [stageMode], [planPath], [options])

4.3.2 Undeploying Java EE Applications

You can undeploy an application from a Managed Server or a cluster. This section describes how to undeploy an application from a Managed Server. If an application has been deployed to multiple servers, when you undeploy it using Fusion Middleware Control, the application is undeployed from all the servers.

To undeploy a Java EE application from a Managed Server:

  1. From the navigation pane, expand Application Deployments, then the application to undeploy.

    The application home page is displayed.

  2. From the Application Deployment menu, select Application Deployment, then Undeploy.

    The confirmation page is displayed.

  3. Click Undeploy.

    Processing messages are displayed.

  4. When the operation completes, click Close.

Alternatively, you can navigate to the domain, Managed Server, or cluster, then, from the target's menu, choose Application Deployment, then Undeploy. In the Select Application page, select the application you want to undeploy.

WLST Command:

undeploy(app_name,path, [targets] [options])

4.3.3 Redeploying Java EE Applications

You can redeploy an application to a Managed Server or a cluster. This section describes how to redeploy an application to a Managed Server.

To redeploy a Java EE application to a Managed Server:

  1. From the navigation pane, expand the farm, then Application Deployments.

  2. Select the application.

    The application home page is displayed.

  3. From the Application Deployment menu, choose Application Deployment, and then Redeploy.

    The Select Application page is displayed.

  4. Click Next.

  5. In the Archive or Exploded Directory section, you can select one of the following:

    • Archive is on the machine where this browser is running. Then, enter the location of the archive or click Browse to find the archive file.

    • Archive or exploded directory is on the server where Enterprise Manager is running. Then, enter the location of the archive or click Browse to find the archive file.

  6. In the Deployment Plan section, you can select one of the following:

    • Create a new deployment plan when deployment configuration is done.

    • Deployment plan is on the machine where this web browser is running. If you select this option, enter the path to the plan.

    • Deployment plan is on the server where Enterprise Manager is running. If you select this option, enter the path to the plan.

  7. Click Next.

    The Application Attributes page is displayed.

  8. Click Next.

    The Deployment Wizard, Deployment Settings page is displayed.

  9. On this page, you can perform common tasks before deploying your application or you can edit the deployment plan or save it to a disk. Depending on the type of application, you can:

    • Configure Web modules

    • Configure application security

    • Configure EJB modules

    • Configure ADF connections

    For a simple Java EE application, only the first three options are displayed.

  10. Expand Deployment Plan.

    You can edit and save the deployment plan, if you choose. If you edit the deployment plan and change descriptor values, those changes are saved to the deployment plan. In addition, the following configurations are saved to the deployment plan:

    • Application attributes

    • Web module configuration

    • EJB configuration

    Application attributes related to MDS are stored in the file adf-config.xml. Application security attributes are stored in weblogic-application.xml.

    Fusion Middleware Control updates the relevant files and repackages the .ear file.

  11. Click Redeploy.

    Processing messages are displayed.

  12. When the operation completes, click Close.

To redeploy an application to a cluster, select the cluster. Then, from the target's menu, select Application Deployment, then Redeploy.

WLST Command:

redeploy(app_name,planpath,  [options])

4.4 Managing Deployment Plans

A deployment plan is a client-side aggregation of all the configuration data needed to deploy an archive into Oracle WebLogic Server. Once created, you can save a deployment plan as a file. Then, you can reuse it for redeploying the application or for deploying other applications. If an existing deployment plan is not applied to an application at the time of deployment, a new plan is created by default.

You can create a deployment plan when you deploy an application, as described in Section 4.3.1.

You can edit it on the Deployment Settings page of the Application Deployment wizard.

4.5 Learn More

For more information about the topics covered in this chapter, see: