|Oracle® Fusion Middleware Developer's Guide for Oracle WebCenter
11g Release 1 (11.1.1)
Part Number E10148-02
This chapter describes how to test custom WebCenter applications on Integrated WebLogic Server (Integrated WLS Server) that comes packaged with Oracle JDeveloper. This chapter also describes how to deploy applications using JDeveloper, to Oracle WebLogic Managed Server instances configured to test application deployment or host applications for the production purpose. For information about deploying custom WebCenter applications through other tools, such as, Oracle Enterprise Manager Fusion Middleware Control, Oracle WebLogic Administration Console, and WLST commands, see the chapter, "Deploying WebCenter Applications" in Oracle Fusion Middleware Administrator's Guide for Oracle WebCenter.
This chapter includes the following sections:
This section provides an overview of Integrated WLS Server and Oracle WebLogic Managed Server (managed server). Using Oracle JDeveloper, you can test your applications on Integrated WLS Server and deploy applications to managed servers that reside outside Oracle JDeveloper.
Integrated WLS Server
Integrated WLS Server (Default Server) comes packaged with Oracle JDeveloper. The Default Server connection appears as IntegratedWLSConnection in Application Server under IDE Connections in the Resource Palette. The Default Server is meant for quick and easy testing of applications in development environments.
When the Default Server is started, an instance of the server is created once for all applications. You can run multiple applications simultaneously. When an application is run on the Default Server, a server instance, named after the application, is created.
Testing custom WebCenter applications on Integrated WLS Server is easy because:
Deployment is optimized and the requirement to zip and copy files is eliminated.
Most files run directly from project directories. This feature enables you to make selected changes and refresh these changes while the application is running. For example, any changes made to a JSPX page can be refreshed immediately, without redeploying the application.
There is no requirement to undeploy applications after testing and debugging. Applications are undeployed when the Default Server becomes unavailable.
Oracle WebLogic Managed Server
A managed server hosts applications and the resources needed by those applications. A domain, which is a logically related group of Oracle WebLogic Server resources, can have any number of managed servers. An Administration Server manages these servers. Managed servers can be deployed to hold production applications or test or both.
When you run an application on the Default Server, a server instance named after the application is created. You can watch the progress of each application in the Run Manager panel. The Run Manager panel also lets you stop the Default Server instances.
This section includes the following:
To run a custom WebCenter application, right-click the
.jspx page in the project folder and select Run. Clicking Run triggers packaging and deployment of your custom WebCenter application on an instance of Integrated WLS Server named after the application.
You can see the DefaultServer Log window to know how the activity is progressing.
Note:When the Integrated WLS Server instance stops, the application is undeployed, and therefore, becomes unavailable.
For a more persistent testing scenario, you can deploy your application to Integrated WLS Server by right-clicking the application and then selecting Deploy. This deploys the application to the Default Server instance and it is always available when the Default Server is running. If you choose this method, then you must first create deployment profiles, as described in Section 25.3.2, "How to Create Deployment Profiles". If you deploy your application to Integrated WLS Server, then the Deployment Configuration dialog displays to let you configure and customize deployment settings. The file system MDS repository pre-created by JDeveloper displays in the Repository Name field.
Oracle WebCenter temporarily modifies
mds-config in the
adf-config.xml file to reconfigure the directory paths for the running application. It provides the menu option Build > Clean Runtime MDS Customizations that lets you remove view-oriented customizations made during testing.
Secure attributes and credentials are migrated by default when running a custom WebCenter application on Integrated WLS Server.
Integrated WLS Server creates an archive directory of your custom WebCenter application at
This section describes how to deploy a custom WebCenter application to an Oracle WebLogic Managed Server instance using JDeveloper. From JDeveloper, you can deploy an application for the testing purpose, or to hold the application in a production environment.
For information about deploying custom WebCenter applications through Fusion Middleware Control, Oracle WebLogic Administration Console, and WLST commands, see the chapter, "Deploying WebCenter Applications" in Oracle Fusion Middleware Administrator's Guide for Oracle WebCenter.
This section includes the following:
This section describes database connections- and application security-related points that you should consider before deploying any custom WebCenter applications.
Custom WebCenter applications use database connection types: JDBC DataSource and JDBC URL. Depending upon the database connections used by an application and tools to be used to deploy or test an application, you can choose which approach out of those discussed in this section is best suited to set up or migrate connection credentials in development and production modes.
This section also describes security migration for applications that use database connections specifying passwords and external applications with shared or public credentials.
This section includes the following sub sections:
This section describes what types of JDBC data sources can be created, what these data sources consist of, and which type to choose and when.
Application-level data source with password indirection: JDeveloper generates this data source when you run an application on Integrated WLS Server. That is, to generate application-level data source with password indirection, the Auto Generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment checkbox is selected by default in the Application Properties dialog, as shown in Figure 25-1. In this case, JDeveloper uses MBean calls to pass the database passwords to the Integrated WLS Server.
Figure 25-1 Auto Generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment Checkbox
To generate an application-level indirection data source, JDeveloper does the following:
*-jdbc.xml file for each connection stored in the Application Resources.
Sets the indirect password attribute in the
<jdbc-driver-params> <use-password-indirection>true</use-password-indirection> </jdbc-driver-params>
*-jdbc.xml file as a module in the
Adds a resource reference to each JDBC JNDI name in the
web.xml file, if this file exists.
If you choose to generate application data source with password indirection, then you must add credential mappings using Oracle WebLogic Administration Console to be able to activate the application. For more information on adding credential mappings, see the section "Creating a JDBC Data Source" in Oracle Fusion Middleware Configuring and Managing JDBC for Oracle WebLogic Server.
Note:Do not use WLST commands to deploy applications that use application-level data sources with password indirection, because WLST cannot set password indirection credential mappings on the server.
Global data source: Choose this type of data source if you plan to deploy applications through Fusion Middleware Control, Oracle WebLogic Administration Console. This data source is also recommended when you deploy an application to an EAR file and then deploy the EAR file through WLST (
wldeployer) command to a managed server running in production mode.
Deselect the Auto Generate and Synchronize weblogic-jdbc.xml Descriptors During Deployment checkbox so that JDeveloper does not create an application-level data source with password indirection. Instead, create the global data source using Oracle WebLogic Administration Console after deploying an application to a managed server in production mode. For more information on creating global data sources, see the section "Creating a JDBC Data Source" in Oracle Fusion Middleware Configuring and Managing JDBC for Oracle WebLogic Server.
For applications that use the JDBC URL connection type, a credential store consisting of
cwallet.sso files is created for each application. These files are stored in the
META-INF directory of the application.
The following is applicable if you configured security in your application using the Configure ADF Security wizard, or the application contains connections with secure attributes, for example, database connection password, external applications with shared or public credentials:
If you do not intend to migrate credentials, then deselect the Credentials checkbox in the Security Deployment Options section in the Application Properties dialog (see Figure 25-2)
Figure 25-2 Security Deployment Options
If you retain the default selection in the Security Deployment Options section, then the credential migration will behave as follows, depending on if the WebLogic domain is in development or production mode:
To enable credential migration for an application to be deployed in development mode, start the managed server with
-Djps.app.credential.overwrite.allowed=true, by adding the following option to the
setDomainEnv.sh file located in
set EXTRA_JAVA_PROPERTIES=-Djps.app.credential.overwrite.allowed=true %EXTRA_JAVA_PROPERTIES%
When you deploy a custom WebCenter application to a managed server running in production mode, secure attributes of the connections packaged within your application and any shared or public credentials specified for external applications are not migrated to the domain-level credential store. This is because secure properties are likely to be different between development and production environments. Therefore, you must reconfigure secure attributes of connections and shared or public credentials for external applications using WLST commands or Fusion Middleware Control, as described in Oracle Fusion Middleware Administrator's Guide for Oracle WebCenter.
In Figure 25-2, in the Security Deployment Options section, the Users and Groups checkbox is selected by default. This indicates that the users and groups created in the application's
jazn-data.xml file will be migrated to the identity store configured on the WebLogic Managed Server, if the authenticator configured in the domain allows creation of users and groups. It is recommended that you deselect this option because, typically, users and groups in the managed server's identity store should be used to access the application.
The Application Policies checkbox must always be selected.
To deploy your application to a WebLogic Server that resides outside JDeveloper, you must first create deployment profiles. A deployment profile packages or archives a custom WebCenter application and associated files so that the application can be deployed to an Oracle WebLogic Managed Server instance. Deployment profiles are created at project and application level. At the project level, a WAR profile is created. This file packages a Web application as a Web Application Archive (WAR) file. It contains the projects to be deployed and any associated files, such as, pages, Java classes,
web.xml, and so on. At the application level, an EAR file is created. This file packages the complete application as an Enterprise Archive (EAR) file. The EAR file contains application artifacts such as,
jazn-data.xml, metadata archive files (
.mar), and all project-related WAR files. For custom WebCenter applications, the MAR is automatically generated and included in the EAR file, if there is MDS metadata to be packaged.
Note:You can deploy Oracle ADF applications, such as custom WebCenter applications, only as EAR files. Therefore, while creating deployment profiles, ensure that the WAR and MAR files of the application are included in the application's EAR file.
Right-click ViewController and select New.
In the New Gallery, expand General, select Deployment Profile, then WAR File, and then click OK.
In the Create Deployment Profile -- WAR File dialog, enter a name for your deployment profile and click OK.
In the WAR Deployment Profile Properties dialog, select the Specify Java EE Web Context Root option and enter a meaningful context root. Then click OK.
In the Project Properties dialog, click OK.
From the File menu, choose New.
In the New Gallery, expand General, select Deployment Profile, then EAR File, and then click OK.
In the Create Deployment Profile -- EAR File dialog, enter a name for your deployment profile and click OK.
In the Edit EAR Deployment Profile Properties dialog, select Application Assembly, then select the project WAR you want to make available in the project file. Click OK.
In the Application Properties dialog, click OK.
In the Application Navigator, right-click the application name, choose Deploy, deployment profile name, to, and then choose to EAR file. This creates the
.ear file in the deploy folder located in
deploy\, as shown in Figure 25-3.
Figure 25-3 EAR Status in Deployment - Log
To deploy a custom WebCenter application to a WebLogic Managed Server instance, you must first create a server instance and provision it with a required set of shared libraries, as described in the section "Creating and Provisioning a WebLogic Managed Server Instance" in Oracle Fusion Middleware Administrator's Guide for Oracle WebCenter.
After creating the WebLogic Managed Server instance, you must create and register a Metadata Service Repository (MDS) schema for the application on the WebLogic Domain's Administration Server instance, as described in the section "Creating and Registering the Metadata Service (MDS) Repository" in Oracle Fusion Middleware Administrator's Guide for Oracle WebCenter.
From Oracle JDeveloper, you can deploy your applications to Oracle WebLogic Managed Server instances that reside outside JDeveloper. To do this, you must first create a connection to the server instance to which you want to deploy your application.
Before you create a connection to an Oracle WebLogic Managed Server instance, ensure that the server instance is up and running.
From the File menu, select New.
In the New Gallery, expand General, select Connections and then Application Server Connection, and click OK.
In the Create Application Server Connection wizard, on Step 1, enter a name for the new connection, for example,
WebCenterServer. Then click Next.
On Step 2, specify user name and password for authentication. Click Next.
On Step 3, enter the host name of the WebLogic Managed Server instance, for example,
webcenter.myserver.oracle.com and the port number, for example,
In the WLS Domain, specify the name of the domain in which the WebLogic Managed Server instance is created, for example,
wl_server. Click Next.
On Step 4, click Test Connection. The connection is set up if the test is successful.
To deploy a WebCenter application:
In the Application Navigator, open the application to be deployed.
From the Application Navigator, select the application, choose Deploy, deployment profile name, to, and then choose the connection name.
In the Select Deployment Target dialog, as shown in Figure 25-4, select the name of the managed server, for example,
WLS_CustomApps, and click OK.
Figure 25-4 Select Deployment Targets dialog
In the Deployment Configuration dialog, under the MDS tab, in the Repository Name, select the metadata repository to be used by the application you are deploying, as shown in Figure 25-5.
Figure 25-5 Deployment Configuration dialog
In the Partition Name field, specify the application's partition name. Each application is recommended to have its own partition. The application name can be used as the partition name.
Under the Connections tab, modify the connections packaged with the custom WebCenter application being deployed.
Note:In the Connections tab, you cannot change secure properties of the connections. It is recommended that you modify these connections post-deployment using Fusion Middleware Control. For information, see the chapter "Managing Services" in Oracle Fusion Middleware Administrator's Guide for Oracle WebCenter.
Click Deploy. The Deployment - Log displays the deployment status, as shown in Figure 25-6.
Figure 25-6 Deployment - Log
During the deployment to an Oracle WebLogic Managed Server instance, the EAR file is generated. The EAR file packages the metadata archive (MAR file), which includes the metadata content to be deployed to an MDS repository. Additionally, the
adf-config.xml file is reconfigured with a modified
mds-config for the target deployment environment. Application-wide features, security, caching, and change persistence remain unchanged. Properties for other Oracle components, if any, are also configured in this file. Similarly, JSF and JSTL shared libraries are added in the
weblogic.xml file during packaging.
When migrating a deployed application to a new environment, post-deployment customizations made to pages, WebCenter Web 2.0 Services, and portlets (PDK-Java and WSRP version 2 producers) must be migrated too. Export and import utilities are available to assist this process. For more information, see the chapter, "Managing Backup, Recovery, Export, and Import of WebCenter" in Oracle Fusion Middleware Administrator's Guide for Oracle WebCenter.