52 Running and Deploying Applications on Oracle WebLogic Server

This chapter provides a basic overview of the Oracle WebLogic Server environment and information about how to run your applications on Integrated WebLogic Server. It also provides information about how to deploy your applications to the Administration Server instance of WebLogic Server for the purpose of performing end-to end testing of new applications. If you are deploying customizations or extensions, see the Oracle Fusion Applications Extensibility Guide.

The scope of this chapter is limited to what is unique in the Oracle Fusion Applications environment. For general details about Oracle WebLogic Server, references are made to the generic Oracle Fusion Middleware guides.

52.1 Introduction to Deploying Applications to Oracle WebLogic Server

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 your Oracle Applications Development Framework (Oracle ADF) applications or SOA 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. You also can run Oracle ADF applications (but not SOA applications) in JDeveloper using Integrated WebLogic Server.

If you are using Integrated WebLogic Server, JDeveloper already provides the environment to run the application using the Run command. You do not need to create deployment descriptors or create standalone WebLogic Server domains. For more information on using Integrated WebLogic Server, see Section 52.2, "Running Applications on Integrated WebLogic Server."

If you are deploying the application to a standalone WebLogic Server instance, you must perform several tasks to prepare the application for deployment. You may need to create or edit deployment descriptors and deployment profiles to prepare the application.

Whether you are using standalone or Integrated WebLogic servers to host the application, you will need to configure the WebLogic domains for Oracle Fusion Applications. You must run the Configure Fusion Domain Wizard from JDeveloper to configure the Integrated WebLogic Server or create a property file that is used to configure standalone WebLogic Server instances. For more information about the wizard, see Chapter 2, "Setting Up Your Development Environment."

Table 52-1 describes some common deployment techniques that you can use during the application development and deployment cycle.

Table 52-1 Deployment Techniques for Development 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.

For example, you can also use the test environment to develop your deployment scripts.

Use JDeveloper to deploy to an EAR file, then use the Oracle WebLogic Server Administration console, WLST commands, or Enterprise Manager 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 WebLogic Server instance.

You can also use the test environment to develop your deployment scripts.

After you have performed the tasks required for standalone deployment, you can use JDeveloper to deploy directly to a WebLogic Server instance or to create an Enterprise Archive (EAR) file and deploy the EAR file using WebLogic Server Administration Console, Enterprise Manager, or WebLogic Scripting Tool (WLST) commands.

If you want more debugging output, set the environment variable using one of the shell commands as shown in Example 52-1, before starting the Administration Server instance of WebLogic Server or before starting JDeveloper if you are going to run Integrated WebLogic Server.

You must disable the Auto Generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment option to use the Global Java Database Connectivity (JDBC) datasource. To do this, open Application Properties and choose the Deployment category as shown in Figure 52-1. Unselect the Auto Generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment option and click OK.

A Weblogic Server instance is a configured instance to host applications, such as Web applications, Enterprise applications, and Web services, and resources, such as Java Message Service (JMS), and JDBC, Diagnostics.

There are two types of WebLogic Server instances: Administration Server and Managed Server.

The Administration Server instance is the central configuration controller for the entire domain. Its purpose is to:

Host the Administration Console.

Enable you to start and stop the servers from a central location.

Enable you to migrate servers and services within the domain.

Enable you to deploy applications within the domain.

Figure 52-2 Administration Server Configuration

There is only one Administration Server WebLogic Server instance in a domain, and an Administration Server WebLogic Server instance controls only one domain.

A Managed Server WebLogic Server instance is a running instance that hosts the applications and the resources that are needed by those applications. Each Managed Server WebLogic Server instance is independent of all other Managed Server WebLogic Server instances in the domain, unless they are in a cluster. You can have as many Managed Server WebLogic Server instances as you need in a domain.

The Administration Server WebLogic Server instance stores the master copy of the domain configuration, including the configuration for all Managed Server WebLogic Server instances in the domain. Each Managed Server WebLogic Server instance stores a local copy of its configuration. When a Managed Server WebLogic Server instance starts, it connects to the Administration Server WebLogic Server instance to synchronize the configuration.

In most cases, a single server environment is used for development purposes. This is where a single server acts as the Administration Server WebLogic Server instance and as the host for applications, as illustrated in Figure 52-3.

However, there are some teams that use a Managed Server for either Oracle Enterprise Scheduler (ESS) runtime or Service-Oriented Architecture (SOA). When you are setting up your standalone WebLogic server, you can choose one of the following options:

You deploy applications to the Administration Server WebLogic Server instance. Only Administration Servers and Managed Servers are used in a production environment. Therefore, all your end-to-end testing should be done using the Administration Server.

There are two types of Administration Servers:

Non-SOA

SOA

Not all components are available in both. For example, WebCenter libraries are not available in SOA and SOA libraries are not available in non-SOA. Oracle ADF applications containing UI must be deployed to the non-SOA WebLogic server, and SOA composites must be deployed to the SOA-configured WebLogic Server.

Some services have a SDO co-location requirement and need to be deployed to the SOA container. If the service must be deployed to the SOA-configured WebLogic Server, create a new EAR profile containing only that service or services from your application workspace.

52.2 Running Applications on Integrated WebLogic Server

Integrated WebLogic Server is a single server that is included within JDeveloper. You can run your applications directly on this server without needing to deploy. Integrated WebLogic Server is sufficient to run your application to make sure it displays correctly in browsers, or for testing and debugging portions of the application. However, real end-to-end testing should be done in an Administration Server instance of WebLogic Server because that is what will be used in a production environment.

Integrated WebLogic Server has already been configured with the Oracle Fusion Middleware Extensions for Applications (ApplCore) domain extension templates so all of the Oracle Fusion applications will run on Integrated WebLogic Server as they would in an Administration Server instance of WebLogic Server.

JDeveloper has a default connection to Integrated WebLogic Server and does not require any deployment profiles or descriptors.

When you run your application in JDeveloper using the run or debug commands, Integrated WebLogic Server starts automatically and your application runs in the target browser.

When you use JDeveloper to run an application for the first time, it automatically creates the Integrated WebLogic Server instance.

You can also start the server directly from within JDeveloper. To do this, go to the main menu and select Run > Start Server Instance.

Tip:

The first time Integrated WebLogic Server starts, it tries to use the first available port in the 7101 - 7105 range. The following message appears as the first line in the Default server log in JDeveloper. You should use the alternate port for all access:

HTTP port conflict detected. The HTTP port will be reassigned to port 7102.

The server and the application are considered separate entities, so even if you stop the application, it does not stop the server. To terminate the application, select the application name from the terminate button dropdown menu in the Server Instance Log page, as shown in Figure 52-5.

Figure 52-5 Terminating the Application

To terminate the server, select the server name, as shown in Figure 52-6.

Figure 52-6 Terminating the Integrated WebLogic Server Instance

52.2.1 How to Deploy an Application with Metadata to Integrated WebLogic Server

When an application is running in Integrated WebLogic Server, the Metadata Archive (MAR) profile itself will not be deployed to a repository. Instead, a simulated Oracle Metadata Services (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 location 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.

Migrate application-level security information to the WebLogic Server instance. For more information, see the "Configuring Security for WebLogic Server" section in the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

Set up JDBC URL for WebLogic Server. For more information, see the "Applications with JDBC URL for WebLogic" section in the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

Set up JDBC datasource for WebLogic Server. For more information, see the "Applications with JDBC Data Source for WebLogic" section in the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

52.3.1 How to Reference the Shared Libraries

Shared libraries are available in the integrated and standalone WebLogic Server container and your projects must be updated so that they can use a shared library.

When you create your WebLogic Server domain, all the required shared libraries should be automatically created for you. When you choose a new technology or library in JDeveloper, the weblogic.xml and weblogic-application.xml files are automatically updated to reference these shared libraries. If, for some reason, the required references are not created automatically, you must update the weblogic.xml and weblogic-application.xml files manually.

The process below shows how to reference a sample oracle.shared.library shared library in a project.

The deployment profiles determine how the application is bundled and deployed to Standalone WebLogic Server. When running an application within JDeveloper using Integrated WebLogic Server, these deployment profiles are not used.

Tip:

When you run your application in JDeveloper Integrated WebLogic Server, these deployment profiles are not used. Instead, JDeveloper scans the entire workspace or the current working set, (if the Run Working Set option is enabled), to construct the class loader classpaths. If the data model project is eligible to be an EJB then the Libraries and Classpath entries from that project contribute to the application root class loader. The user interface project contributes to the web application class loader.

To deploy the application, you must create deployment profiles applicable to the project or projects. The deployment profiles you need depend on your application requirements. For example, an application may include Business Components Service Interface, Web Application Archive (WAR), and MAR profiles. Once you have defined these, create an EAR deployment profile for the application.

You can only deploy the application as an EAR file at the application level. Creating EAR files from the project level are incomplete and this option is disabled. The project level deployment profiles should be included in the EAR deployment profile.

Depending on the type of projects in your application, you may need to create the following deployment profiles:

You can deploy your Oracle ADF applications to a standalone WebLogic Server instance using JDeveloper or Ant commands.

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

Note:

If you are using the 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 Design Time at Runtime. For more information about WLST commands, see the Oracle Fusion Middleware WebLogic Scripting Tool Command Reference.

52.4.1 How to Create an Application Server Connection Using JDeveloper

To deploy your application using JDeveloper, you create a connection to the application server and then deploy the application.

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

Figure 52-8 MDS Configuration and Customization For Deployment

The Repository Name dropdown list allows you to choose a target metadata repository from a list of metadata repositories registered with the Administration Server instance of WebLogic 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.

Note:

If you are deploying an Oracle ADF application, do not use the Deploy to all instances in the domain option.

Click Finish.

Verify the run-time application as:

http://httpHost:httpPORT/<CONTEXT>/faces/<landing jspx

For example, http://server06.us.company.com:7001/UIPatternsDemo/faces/ServiceRequest

52.4.3 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, or the Oracle WebLogic Server Administration Console.

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

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.

You can deploy your SOA projects using either JDeveloper or the other administration tools described in Table 52-1.

52.5.1 How to Deploy Your SOA Projects Using JDeveloper

This section discusses how to deploy your SOA projects into the Administration Server instance of WebLogic Server using JDeveloper.

The basic steps to deploying your SOA project from within JDeveloper are:

Define a connection. For instructions to create an application server connection, see the "To create an application server connection" section of the Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite.

Deploy the Project. For instructions to deploy a SOA project, see the "Deploying the Profile " section of the Oracle Fusion Middleware Developer's Guide for Oracle SOA Suite

Check the deployed SOA Project.

52.5.1.1 Check the Deployed SOA Project

You can check and run your deployed SOA project from two locations:

From Enterprise Manager on port 7001 by opening the Weblogic Hostname (Administration Server) URL for which you created the Connection, such as:

http://xyzzy-on.us.oracle.com:7001/em

After you log in, a screen similar to Figure 52-9 displays (the SOA tree in the left pane has been expanded and the first deployment has been selected):