Deploying the GreaterCause Application


In this section, we discuss the steps involved in installing the Greater Cause application. The accompanying download contains the source code and the installation scripts.

Note

The configurations explained in this section are geared toward a Windows-based installation.

The contents of the downloaded GreaterCause directory that will be used for installing the GreaterCause application are described briefly here:

Directory

Contents


GreaterCause

Ant build script and the corresponding properties file for building the application from source.


GreaterCause\bin

Command script that uses Ant build script for building the jar, war, and ear files.


GreaterCause\build\archives

Pre-built binaries for direct deployment of the GreaterCause application; also binaries built by the Ant script provided in this chapter.


GreaterCause\conf

See the following table for complete explanation.


GreaterCause\lib

Binaries used by Struts and Ant. (All binaries with the exception of ant.jar, xercesImpl.jar, and xmlParserAPIs.jar are required by Struts.)


GreaterCause\src\java

Complete source code of the application.


GreaterCause\src\sql

DDL script and script for loading sample data.


GreaterCause\src\web

GreaterCause JSPs.


GreaterCause\src\web\en_US

en_US locale-specific JSPs.


GreaterCause\src\web\images

Default image files referenced by default ApplicationResources.properties file (see the following table).

The following is a list of files in the configuration directory (GreaterCause\conf) together with their usage:

Name

Usage


web.xml

Deployment descriptor for the web application


weblogic.xml

Vendor-specific deployment descriptor for the web application


weblogic-cmp-rdbms-jar.xml

Vendor-specific deployment descriptor for cmp- and cmr-fields mapping to the database schema


ejb-jar.xml

Deployment descriptor for the enterprise beans


weblogic-ejb-jar.xml

Vendor-specific deployment descriptor for the enterprise beans


application.xml

Deployment descriptor for the J2EE application


struts-config.xml

Struts-specific configuration file


ApplicationResources.properties

Default resource bundle as specified by the message-resources element in the struts-config.xml file


validation.xml

File containing basic validators packaged with Struts


validation-rules.xml

Configuration file for specifying validations associated with form-bean properties


*.tld

Tag library descriptors files

Priming the Database

At this point, we assume that you have started an instance of the Oracle database server. This section will help you create the necessary tables required for the application (explained in Chapter 6), and load some test data. Before the tables can be created, update the GC.Properties file provided in the GreaterCause directory. The GC.properties must have values specified for the following properties:

  • DBSERVER=

  • DBPORT=

  • SID=

  • USER=

  • PASSWORD=

For creating tables, provide the following at the command prompt:

 GreaterCause\bin> build db_create_tables 

For populating test data, provide the following at the command prompt:

 GreaterCause\bin> build db_load_tables 

Deploying GreaterCause.ear

The following steps are for deploying the GreaterCause application using the .ear file provided in the GreaterCause/build/archives directory:

  1. Bring up the WebLogic console using the URL http://localhost:7001/console.

  2. Select mydomain | Deployments | Applications in the left-hand frame.

  3. Select the Configure A New Application link in the right-hand frame. This will show the Locate Application Or Component To Configure page.

  4. Locate the GreaterCause.ear in the directory GreaterCause\build\archives and choose [select] to proceed to the next step.

  5. Select myserver from Available Servers and move it to the Target Servers window. Select <Configure and Deploy>.

Note

You can access the home page of GreaterCause by using the URL http://localhost:7001/GreaterCause or http://localhost:7001/GreaterCause/1_HomePage.jsp.

Building the GreaterCause Application

The following steps are for building and deploying the GreaterCause application using the source files provided in the GreaterCause\src directory:

  1. Set the WL_Domain in the GC.properties file provided in the GreaterCause directory.

  2. For creating and deploying the .ear file, provide the following at the command prompt: GreaterCause\bin> build All

  3. Bring up the WebLogic console using the URL http://localhost:7001/console.

  4. Select mydomain | Deployments | Applications | _appsdir_GreaterCause in the left-hand frame.

  5. Select the Deploy tab in the right-hand frame. Ensure that the Deployed status is true for GreaterCause.jar and GreaterCause.war.

Note

The ejb-client-jar element in the ejb-jar.xml deployment descriptor specifies the name of a jar file that will contain the classes required for accessing the EJBs on the server. This jar file is automatically included by the build script in the WEB-INF/lib directory of the web application.




Practical J2ee Application Architecture
Practical J2EE Application Architecture
ISBN: 0072227117
EAN: 2147483647
Year: 2003
Pages: 111
Authors: Nadir Gulzar

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net