Application Installation

We discusss how to install a template applications.

The following assumes your server has a suitable database manager and JSP container. You will also need the ant build tool.

 

Summary

Basic steps are as follows
Download and Unpack Source

mkdir ~/adev/app-name
cd ~/adev/app-name
tar xzf app-name-version.tgz
Create data base bin/db_create
Edit Application Configuration confirm web/WEB-INF/myapp.cnf
Build Local Version ant
Deploy to Web Container sudo bin/tcx
Test browse to http://localhost:8080/app-name

This takes about 5-10 minutes if you keep to the defaults and have a consistent environment. The install scripts and configuration files have the following values.

Application Home/opt/tomcat/webapp/app-name
JSP Container Home/opt/tomcat
Build Home~/adev/app-name
Jar home/usr/local/java/java-lib
JDBC Connector jarjdbc-connector.jar
JDBC driver class org.gjt.mm.mysql.Driver

Sample Values

We will assume the user is named xap and the application is called axContact. We assume xap is an administrator on OS X.

The following are representative values. Windows will of course have the c: prefix and backslashes.

ParamOS Xlinux
Home-Directory/Users/xap/home/xap
Application Home/Library/JWSDP/Home/webapps/axContact/opt/tomcat/webapp/axContact
JSP Container Home/Library/JWSDP/Home
with link /opt/tomcat
/opt/tomcat
Build Directory/Users/xap/adev/home/xap/adev
Build Home/Users/xap/adev/axContact/home/xap/adev/axContact
 

Dowload and Unpack Source

Download template application. The default values in the templates assume they will go into a development area named User-Home/adev/App-Name. We will call this the Build Home.

Move the down load to the Build Directory and extract, eg


	 cd ~/adev/axContact
	 tar xzf axContact-040128.tgz
This will create the following structure. Note that the tarball does not have a containing directory
  • bin: contains utility scripts. Note that these are assumed to be executed from the Build directory as bin/tcx etc.
    • appContext.txt: common parameters for the scripts.
    • db_bu: back up the data base to an archive
    • tcx: install the application, restarts the JSP container
    • tgz: archive the source. Does not create a containing directory.
    • mstage: generate source using zCFac.
    • db_create: run database creation for mysql.
  • dbase
    • create.sql: SQL to create database and schema.
    • db_init.sql: SQL for initial values
    • grant.sql: SQL to grant permission to default app user
  • src: source code
    • com: generic sources. usually empty
    • xap: source for this app
      • app: overall application context
      • xmgr: business objects
  • stage: source to generate code with zCFac code factory
    • axContact.txt: object definitions
    • cxCfac.cnf: config file for code factory.
    • generated files
    • optional include files for code generator
  • web: JSP and web page source
    • jsp files: major files and styles.
    • images/: directory with images
    • menus/: javascript for optional dropdown menues
    • help/:directory with help pages
    • common/: directory with common pages. See site layout in help.
    • WEB-INF/: standard directory. Includes config and eden jar.
  • build.xml: directions on building using ant.
 

Create Data Base

Here you create and initialize the data base for the app. If you are using MySql, the basic steps are


	 mysql < create.sql
	 mysql < db_init.sql
	 mysql < grant.sql

The script bin/db_create runs these. These assume you have a suitable .my.cnf.

The grant will give access to the user ax_app. You need to check that the grant has the proper hostname for your server. You can use set to ascertain the hostname.

Some versions of mysql give errors on defaults for timestamps. You can simply remove the default in this case.

 

Edit Application Configuration

These tell how to connect to the database and where resources are located. We strongly reccommend that you consider adjusting passwords.

Mostly you need to make sure you have the right home directory for you application. For an application named axContact, the home might be /Library/JWSDP/Home/webapps/axContact for OS X or /opt/tomcat/webapps/axContact for linux. The defaults assume the following
ItemValue
Home directory for web container /opt/tomcat
Application_Name as in down load
Build Directory ~/adev/Application_Name
Data Base Name as in download
Java Jar Home /Library/Java/Extensions
Edenllc jar in web/WEB-INF/lib
JDBC Connector jar ${javajar.home}/jdbc-connector.jar
deploy home ${catalina.home}/webapps/${app.name}

Web application context

The source version is usually at web/WEB-INF/web.xml. This is a standard xml file for your JSP container. Check <context-param> for <param-name>appCnf</param-name>. Set the <param-value> to the location of Eden Properties, e.g., /opt/tomcat/webapps/axContact/WEB-INF/myapp.cnf. Note that this is the location for in the deployed application.

Eden Properties

The default is in web/WEB-INF/myapp.cnf. The text file defines how to connect to the databases. It is intentionally separate from the web.xml to support batch applications.

You may need to set the following to your applications
ParameterDefaultDescription
dsjdbc:mysql://localhost/axContact Data base to connect to.
pwdax_app Password for logging on to database.
uidax_app User name for logging on to database.
jdbc_driverorg.gjt.mm.mysql.Driver Class name of jdbc connector. Default is for mysql.
home/opt/tomcat/webapps/axContact The location to where the application will be deployed.
listDirectory/opt/tomcat/webapps/APP_NAME/lists/ Where lists are stored, if your app has lists, eg. axContact.
jarKey@try key The key for the license to the edenllc.util package.

Script Parameters

The file bin/appCtxt.txt provides parameters used by the other scripts in bin. You will need to change them if you do not meet the default assumptions.

 

Build Local Version

Check the build instructions

build.xml contains the directions for the build. Check the locations and jars for the java libraries and the container home match your environment. They should be declared about line 125.

  • javajar.home: location of java jars for class path
  • catalina.home: JSP container home
  • jdbc.jar; JDBC connector
  • edenllc.jar: location of com.edenllc.util jar.

Build the application

Invoke ant to build the application.

	 ant

This should produce a build directory with classes and libraries. If you have errors, they are generally due to improper paths or missing jars.

 

Deploy to Web Container

You can use the script bin/tcx to deploy the application. Check that CATALINA_HOME is set to the correct location This will deploy the application to the web container and restart the web container.

	 sudo bin/tcx

You can edit that the script to erase logs on start up. This is useful if you need a bit of debugging.

 

Test

  • Use browser to access the application. For our example, the basic URL is http://localhost:8080/axContact
  • Click the link to Codes. You should see a list of menu codes. This indicates that you have the app installed, it initializes, and you can connect access the data base.
  • Try other links. You may need to add data for business objects to see entries.

 

Trouble Shooting

ErrorCause
Class not found Improper path. jar file not found.
permission Administrator or superuser must execute command
No data Telltales symptoms are empty drop down and total record counts of -1
  • Improper user/password.
  • Grant does not match the hostname.
  • Improper driver.
  • Not entries in the data base

Places to look for hints and diagnostics are

  • Container logs. Look at the startup message for the log. Common loctions are logs/launcher.server.log and logs/catalina.out
  • Web page message.
 
 

eden logo Copyright 2004. Lester Pieniazek. All rights reserved Worldwide.