How to Create an EAR File for Deployment What You May Need to Know About ADF Libraries

Deploying an ADF Java EE Application 8-29 managing the MDS repository, see the Oracle Fusion Middleware Administrators Guide. Figure 8–3 MDS Configuration and Customization for Deployment For more information on creating application server connections, see Section 8.3.1, How to Create a Connection to the Target Application Server.

8.4.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, WLSTwsadmin scripts, Oracle WebLogic Server Administration Console, or WebSphere Administrative Tool, respectively. Although an Oracle ADF Java EE 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. Note: If you are deploying a Java EE application, click the application menu next to the Java EE application in the Application Navigator. 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. 8-30 Java EE Developers Guide for Oracle Application Development Framework To create an EAR archive file: ■ In the Application Navigator, right-click the application containing the deployment profile, and choose Deploy deployment profile to EAR file. If an EAR file is deployed at the application level, and it has dependencies on a JAR file in the data model project and dependencies on a WAR file in the view-controller project, then the files will be located in the following directories by default: – ApplicationDirectory deployEARdeploymentprofile.EAR – ApplicationDirectory ModelProjectdeployJARdeploymentprofil e .JAR – ApplicationDirectory ViewControllerProjectdeployWARdeployme ntprofile .WAR

8.4.3 How to Deploy New Customizations Applied to ADF LIbrary

If you have created new customizations for an ADF Library, you can use the MAR profile to deploy these customizations to any deployed application that consumes that ADF Library. For instance, applicationA, which consumes ADFLibraryB, was deployed to a remote application server. Later on, when new customizations are added to ADFLibraryB, you only need to deploy the updated customizations into applicationA . You do not need to repackage and redeploy the whole application, nor do you need to manually patch the MDS repository. To deploy ADF Library customizations, create a new MAR profile that includes only the customizations to be deployed and then use JDeveloper to: ■ Deploy the customizations directly into the MDS repository in the remote application server. ■ Deploy the customizations to a JAR. And then import the JAR into the MDS repository using tools such as the Fusion Middleware Control.

8.4.3.1 Exporting Customization to a Deployed Application

You can export the customizations directly from JDeveloper into the MDS repository for the deployed application on the remote application server. Before you begin: Create new customizations to the ADF Library using the deployer role in JDeveloper. To export the customizations directly into the application server: 1. In the Application Navigator, right-click the application and choose Deploy metadata . Tip: Choose View Log to see messages generated during the creation of the archive file. Note: This procedure is for applying ADF Library customization changes to an application that has already been deployed to a remote application server. It is not for the initial packaging of customizations into a MAR that will eventually be a part of an EAR. For information about the initial packaging of the customization using a MAR, see Section 8.3.2.3, Creating a MAR Deployment Profile. Deploying an ADF Java EE Application 8-31

2. In the Deploy Metadata dialog Deployment Action page, select Export to a

Deployed Application and click Next. If the MAR profile is included in any of the application’s EAR profiles, Export to a Deployed Application will be dimmed and disabled. 3. In the Application Server page, select the application server connection and click Next . 4. For WebLogic Server, the Server Instance page appears. In this page, select the server instance where the deployed application is located and click Next. 5. In the Deployed Application page, select the application you want to apply the customizations to and click Next.

6. In the Sandbox Instance page, if you want to deploy to a sandbox, select Deploy to

an associated sandbox , choose the sandbox instance and click Next. 7. In the Summary page, verify the information and click Finish.

8.4.3.2 Deploying Customizations to a JAR

When you deploy the ADF Library customizations to a JAR, you are packaging the contents as defined by the MAR profile. Before you begin: Create new customizations to the ADF Library using the deployer role in JDeveloper. To deploy the customizations as a JAR 1. In the Application Navigator, right-click the application and choose Deploy metadata .

2. In the Deploy Metadata dialog Deployment Action page, select Deploy to MAR.

3. In the Summary page, click Finish.

4. Use Enterprise Manager Fusion Middleware Control or the application server’s administration tool to import the JAR into the MDS repository.

8.4.4 What You May Need to Know About ADF Libraries

An ADF Library is a JAR file that contains JAR services registered for ADF components such as ADF task flows, pages, or application modules. If you want the ADF components in a project to be reusable, you create an ADF Library deployment profile for the project and then create an ADF Library JAR based on that profile. An application or project can consume the ADF Library JAR when you add it using the Resource Palette or manually by adding it to the library classpath. When the ADF Library JAR is added to a project, it will be included in the project’s WAR file if the Deployed by Default option is selected. For more information, see the Reusing Application Components section of the Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework.

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