Skip Headers
Oracle® WebCenter Framework Building a WebCenter Application Step by Step
10g (10.1.3.2.0)

Part Number B31073-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

10 Deploying Your Application

The steps in this chapter will show you how to deploy your application using the Application Server Control Console. To learn how to deploy your application to a production environment, refer to the Oracle WebCenter Framework Developer's Guide.

To deploy the SRDemo application to an Oracle Application Server or a standalone OC4J, you must perform the following steps:

Step 1: Creating the Generic EAR file

To create the generic EAR file, perform the following steps:

  1. Open your Oracle JDeveloper, go to Applications Navigator, right-click User Interface, and select New. The New Gallery displays.

  2. Under General, select Deployment Profiles and under Items select WebCenter Application WAR. The Create WebCenter Application Deployment Profile dialog box displays.

  3. In the File Name field, enter SRDemoSample_WebCenter.deploy, as shown in Figure 10-1, and click OK.

    Figure 10-1 Create WebCenter Application Deployment Profile

    Description of Figure 10-1 follows
    Description of "Figure 10-1 Create WebCenter Application Deployment Profile"

  4. The deployment profile is created in the Resources folder under User Interface, as shown in Figure 10-2.

    Figure 10-2 Deployment Profile

    Description of Figure 10-2 follows
    Description of "Figure 10-2 Deployment Profile"

  5. Right-click the deployment profile and select Properties. The WAR Deployment Profile Properties dialog box is displayed.

  6. Select Profile Dependencies, then go to DataModel.jpr, and select the SRFacade.deploy check box, as shown in Figure 10-3.

    Figure 10-3 SRFacade.deploy

    Description of Figure 10-3 follows
    Description of "Figure 10-3 SRFacade.deploy"

  7. Click OK.

  8. Under Resources, right-click SRDemoSample_WebCenter.deploy and select Deploy to EAR file. This generates the EAR file. The Deployment - Log shows an output similar to Example 10-1.

    Example 10-1 Deployment - Log

    ----  Deployment started.  ----    May 29, 2007 1:24:32 PM
    Target platform is Standard J2EE.
    Exporting portlet metadata and customizations
    Wrote EJB JAR file to C:\SRDemo\wc_starter\SRDemoSample_WCS\DataModel\deploy\SRFacade.jar
    Wrote WAR file to C:\SRDemo\wc_starter\SRDemoSample_WCS\UserInterface\deploy\SRDemoSample_WebCenter.war
    Wrote EAR file to C:\SRDemo\wc_starter\SRDemoSample_WCS\UserInterface\deploy\SRDemoSample_WebCenter.ear
    Elapsed time for deployment:  25 seconds
    ----  Deployment finished.  ----    May 29, 2007 1:24:57 PM
    
  9. Locate the EAR file.

  10. Copy it to the machine that has Oracle Application Server running on it. You can do this using a mapped drive on Windows, or by using FTP.

Step 2: Creating the Targeted EAR File

Now, switch to the machine that has your Oracle Application Server installed on it and perform the following steps:

  1. Open a command prompt.

  2. Run the Predeployment tool to create a targeted EAR file as follows:

    C:\java\srdemo_oc4j>C:\java\jdev\jdk\bin\java -jar C:\java\srdemo_oc4j\adfp\lib\portlet-client-deploy.jar -predeploy -source
    C:\Temp\SRDemoSample_WebCenter.ear -target C:\Temp\SRDemoSample_WC_target.ear
    

    Note:

    The syntax to create a targeted EAR must be in a single line. It is wrapped in this example for readability.

    See chapter titled Deploying Your WebCenter Application" in Oracle WebCenter Framework Developer's Guide for explanation of this syntax.

    Where the source file is the generic EAR file created earlier.

    You will be prompted to specify various settings while you run the Predeployment tool. The output will look like Example 10-2 (user defined settings in bold):

    Example 10-2 Output of the Predeployment Tool

    Processing Arguments
    Run Mode : 1
    Source : C:\Temp\SRDemoSample_WebCenter.ear
    Target : C:\Temp\SRDemoSample_WC_target.ear
    Deployed App : null
    Mapping File : null
    Deployed App : null 
    Cleaning up C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\predeploy\
    May 16, 2007 12:25:33 PM oracle.adf.share.config.ADFConfigFactory findOrCreateADF
    Config
    INFO: oracle.adf.share.config.ADFConfigFactory No META-INF/adf-config.xml found
    Processing source EAR file
    Source EAR file processed
    Processing adf-config.xml 
    adf-config.xml processed 
    Processing connections.xml
    connections.xml processed
    
    Creating a new Deployment Profile for : C:\Temp\SRDemoSample_WebCenter.ear
    
    Development MDS Repository Path : ../../mds/;../../ 
    Enter new MDS Repository Path :
    C:\java\srdemo_oc4j\mds\SRDemo 
    
    Producer : OmniPortletProducer_11743434494566c52fb80-0111-1000-8001-a9fe02025106
    
    Current Service URL :  http://pdtsdemo1.us.oracle.com:8888/portalTools/omniPortl
    et/providers/omniPortlet
    Current Proxy URL   : 
    Current Proxy Port   : 0 
    Do you want to modify this connection? (Y/N [default=N]) :
    N
    
    Validating producer OmniPortletProducer_11743434494566c52fb80-0111-1000-8001-a9fe02025106
    .
    .
    .
    Do you wish to save this new Deployment Profile (Y/N [default=N]) : 
    y 
    Enter a name for this Deployment Profile (e.g. 'Production') : 
    srdemo_deploy 
    Enter the path for the Deployment Profile XML file (e.g. 'C:\profile.xml'):
    C:\temp\srdemo_deploy.xml
    Saving to C:\temp\srdemo_deploy.xml
    Cleaning up C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\predeploy\ 
    Extracting View Documents, MDS and connections.xml from source EAR file
    Examining contents of SRDemoSample_WebCenter.war
    Moving C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\predeploy\tmppkg\views\SRDemoSample_WebCenter\WEB-INF to 
    C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\predeploy\view\UserInterface\public_html\WEB-INF
    .
    .
    .
    MDS extracted from source EAR file
    Creating target EAR file 
    Processing source EAR file
    .
    .
    .
    Source EAR file processed 
    Processing adf-config.xml
    adf/META-INF/adf-config.xml [Recreated]
    adf-config.xml processed
    Processing connections.xml
    Validating producer OmniPortletProducer_11743434494566c52fb80-0111-1000-8001-a9fe02025106
    .
    .
    .
    adf/META-INF/connections.xml [Recreated]
    connections.xml processed
    Processing SRDemoSample_WebCenter.war
    WEB-INF/lib/META-INF/adf-config.xml [Recreated in WAR file] 
    WEB-INF/classes/META-INF/connections.xml [Recreated in WAR file] 
    WEB-INF/lib/META-INF/connections.xml [Recreated in WAR file]
    SRDemoSample_WebCenter.war [Recreated] 
    WAR file processed
    Creating target EAR file
    WAR file processed
    source MDS Path (temp) : C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\predeploy\mds
    Production MDS Path : C:\java\srdemo_oc4j\mds\SRDemo
    Connections.xml Path : C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\predeploy\connections.xml.new
    Export ID : /export
    May 16, 2007 12:25:58 PM oracle.mds
    NOTIFICATION: "oracle.portlet.client.persistenceimpl.mds.ImportListener"::"preOperation" is being invoked.
    .
    .
    .
    NOTIFICATION: Transferring the document /UserInterface/public_html/app/staff/SRS taffSearch.jspx.
    NOTIFICATION: import is completed. Total number of documents successfully proces sed : 24, total number of documents failed : 0. 
    Moving C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\predeploy\SRDemoSample_WC_target.ear t o C:\Temp\SRDemoSample_WC_target.ear 
    Target EAR C:\Temp\SRDemoSample_WC_target.ear created
    Cleaning up C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\predeploy\
    

    Note:

    in Example 10-2, existing settings for all the portlet producers remain unchanged. You can change them by specifying Y and then providing the appropriate path to the new producer location.

Step 3: Setting Up the Users and Roles

Since the SRDemo users and roles will not yet exist on Oracle Application Server to which you want to deploy the application, you must update the global system-jazn-data.xml file for the application server or standalone OC4J by running the JAZN Migration Tool in realm mode.

Note:

You have already performed this step in the development environment, but since you may not have Oracle JDeveloper installed on the system that hosts your Oracle Application Server, these steps will show you how to do it by calling the JAZN Migration tool directly.

To add the SRDemo users and roles, perform the following steps:

  1. Locate the system-jazn-data-starter.xml file in the starter ZIP file. This contains the users and roles.

  2. Backup your OC4J's system-jazn-data.xml file, located in ORACLE_HOME\j2ee\home\config\system-jazn-data.xml.

  3. Open a command prompt.

  4. Set the classpath as follows:

    set CLASSPATH = ORACLE_HOME/j2ee/home/jazn.jar;ORACLE_HOME/BC4J/lib/adfshare.jar
    

    For example, if your ORACLE_HOME is C:\java\srdemo_oc4j, set the classpath as follows:

    set CLASSPATH = C:\java\srdemo_oc4j/j2ee/home/jazn.jar; C:\java\srdemo_oc4j/BC4J/lib/adfshare.jar
    
  5. Run the JAZN Migration tool as follows (This assumes the same Oracle home location again.)

    java oracle.security.jazn.tools.JAZNMigrationTool -sr jazn.com -dr jazn.com -st
    xml -dt xml -sf C:\Temp\system-jazn-data-starter.xml -df C:\java\srdemo_
    oc4j\j2ee\home\config\system-jazn-data.xml -m realm
    

Step 4: Setting Up the Sample Content

You must set up the sample content on the system that hosts your Oracle Application Server in the same way you did this for the development environment. To do this, extract the content of srcontentrepository.zip from C:\SDemo_App_Download to C:\srdemo.

Note:

If you are using UNIX, you will need to update your connections.xml file with the path to the content repository. Open the connections.xml file and search for C:\srdemo\SRContentRepository, and update the path to point to the directory where you extracted the sample content.

If you are using Windows and you chose not to extract the content to the suggested directory, you will also need to update your connections.xml file with the path you chose.

Step 5: Deploying the Application

Now that you have generated the targeted EAR file, you are ready to deploy it. You do this using Application Server Control Console as follows:

  1. To access Application Server Control Console, navigate to the following URL: http://<host_name>.<domain>:<port>/em.

    For example, http://test.acme.com:8888/em.

    To find the exact URL for your Application Server Control Console, look at readme.txt. After installation, this text file is saved to the following Oracle Application Server location:

    On UNIX: ORACLE_HOME/install/readme.txt

    On Windows: ORACLE_HOME\install\readme.txt

  2. Log in to the Application Server Control Console. The Cluster Topology page is displayed.

  3. On the Cluster Topology page, click the link to your application server.

  4. Select the Applications tab (Figure 10-4) and click Deploy. The Deploy: Select Archive page is displayed.

    Figure 10-4 Applications Tab of Application Server Control Console

    Description of Figure 10-4 follows
    Description of "Figure 10-4 Applications Tab of Application Server Control Console "

  5. Select the Archive is present on local host option and browse to the location of the EAR file. Then, click Next.

  6. In the Deploy: Application Attributes page, enter the context root of your Web application as the application name or what you configured while creating the deployment profile.

  7. Deployment Settings page is displayed. If required, then make the changes in this page and click Deploy.

  8. The deployment confirmation page is displayed with output like Figure 10-4.

    Example 10-3 Deployment Confirmation Output

    [May 16, 2007 5:05:11 PM] Application Deployer for SRDemo STARTS.
    [May 16, 2007 5:05:11 PM] Copy the archive to C:\java\srdemo_oc4j\j2ee\home\applications\SRDemo.ear
    [May 16, 2007 5:05:12 PM] Initialize C:\java\srdemo_
    oc4j\j2ee\home\applications\SRDemo.ear begins...
    [May 16, 2007 5:05:12 PM] Unpacking SRDemo.ear
    [May 16, 2007 5:05:15 PM] Done unpacking SRDemo.ear
    [May 16, 2007 5:05:15 PM] Unpacking SRDemoSample_WebCenter.war
    [May 16, 2007 5:05:25 PM] Done unpacking SRDemoSample_WebCenter.war 
    [May 16, 2007 5:05:26 PM] Initialize C:\java\srdemo_
    oc4j\j2ee\home\applications\SRDemo.ear ends... 
    [May 16, 2007 5:05:26 PM] Starting application : SRDemo
    [May 16, 2007 5:05:26 PM] Initializing ClassLoader(s)
    [May 16, 2007 5:05:26 PM] Initializing EJB container
    [May 16, 2007 5:05:26 PM] Loading connector(s)
    [May 16, 2007 5:05:27 PM] Starting up resource adapters
    [May 16, 2007 5:05:27 PM] Processing EJB module: SRFacade.jar
    [May 16, 2007 5:05:29 PM] Initializing EJB sessions
    [May 16, 2007 5:05:29 PM] Committing ClassLoader(s)
    [May 16, 2007 5:05:29 PM] Initialize SRDemoSample_WebCenter begins...
    [May 16, 2007 5:05:29 PM] Initialize SRDemoSample_WebCenter ends...
    [May 16, 2007 5:05:29 PM] Started application : SRDemo
    [May 16, 2007 5:05:29 PM] Binding web application(s) to site default-web-site begins...
    [May 16, 2007 5:05:29 PM] Binding SRDemoSample_WebCenter web-module for
    application SRDemo to site default-web-site under context root SRDemo
    [May 16, 2007 5:06:54 PM] Initializing Servlet: javax.faces.webapp.FacesServlet for web application SRDemoSample_WebCenter
    [May 16, 2007 5:06:55 PM] Initializing
    Servlet:oracle.adfinternal.view.faces.renderkit.html.portlet.ADFPortletServlet for web application SRDemoSample_WebCenter 
    [May 16, 2007 5:06:55 PM] Binding web application(s) to site default-web-site ends...
    [May 16, 2007 5:06:55 PM] Application Deployer for SRDemo COMPLETES. Operation time: 103484 msecs
    
  9. Go to the Applications tab and select your application. Then, click Administration.

  10. Under Administration Tasks, click Configure Class Loading.

  11. De-select Apache.commons.logging.

The application is now deployed, but you cannot access it yet. You must first deploy the security policies.

Note:

For this example, we expect that the sample still resides in the same database. The targeted EAR file will be configured to use the database connection that you configured in the development environment. If this connection does not exist, you may need to use Application Server Control Console to create a new database connection using the same name that you used in the development environment. See the installation file section titled "Running the Completed Demo." for more information about running the database scripts.

Step 6: Deploying the Security Policy

The security policy is bundled in the application's EAR file in the app-jazn-data.xml file. To deploy the policies for your application, perform the following steps:

  1. Locate the app-jazn-data.xml file. If your ORACLE_HOME is C:\java\srdemo_oc4j , then this file should be located at C:\java\srdemo_oc4j\j2ee\home\applications\SRDemo\adf\META-INF\app-jazn-data.xml.

  2. Open a command prompt.

  3. Set the classpath as follows:

    set CLASSPATH = ORACLE_HOME/j2ee/home/jazn.jar;ORACLE_HOME/BC4J/lib/adfshare.jar
    

    For example, if your ORACLE_HOME is C:\java\srdemo_oc4j, set the classpath as follows:

    set CLASSPATH = C:\java\srdemo_oc4j/j2ee/home/jazn.jar; C:\java\srdemo_oc4j/BC4J/lib/adfshare.jar
    
  4. Run the JAZN Migration tool as follows (This assumes that C:\java\srdemo_oc4j is the Oracle home location.):

    java oracle.security.jazn.tools.JAZNMigrationTool -sr jazn.com -dr jazn.com
    -st xml -dt xml -sf C:\java\srdemo_
    oc4j\j2ee\home\applications\SRDemo\adf\META-INF\app-jazn-data.xml -df
    C:\java\srdemo_oc4j\j2ee\home\config\system-jazn-data.xml -m policy
    
  5. Restart OC4J.

This migrates the policy information. You are now ready to run the application.

Step 7: Accessing the Application

You can now access the SRDemo. To do this, perform the following steps:

  1. Open a browser and navigate to

    http://appserver_host_name:appserver_port_number/SRDemo/faces/app/SRWelcome.jspx
    
  2. Log in to see the SRDemo.

Summary

This chapter showed you how to take your application and deploy it. You should now be able to run your application and view the pages and components you created throughout this manual. You can also compare your application to the completed version provided to you in the sample files. To do so, follow the instructions to run the completed demo in the install.html file.