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 |
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
The following steps are for deploying the GreaterCause application using the .ear file provided in the GreaterCause/build/archives directory:
Bring up the WebLogic console using the URL http://localhost:7001/console.
Select mydomain | Deployments | Applications in the left-hand frame.
Select the Configure A New Application link in the right-hand frame. This will show the Locate Application Or Component To Configure page.
Locate the GreaterCause.ear in the directory GreaterCause\build\archives and choose [select] to proceed to the next step.
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. |
The following steps are for building and deploying the GreaterCause application using the source files provided in the GreaterCause\src directory:
Set the WL_Domain in the GC.properties file provided in the GreaterCause directory.
For creating and deploying the .ear file, provide the following at the command prompt: GreaterCause\bin> build All
Bring up the WebLogic console using the URL http://localhost:7001/console.
Select mydomain | Deployments | Applications | _appsdir_GreaterCause in the left-hand frame.
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. |