Laboration Environment
For the assignments in this course you will use a provided laboration environment.
This environment consists of a preconfigured version of
Tomcat,
which have been bundled with
Axis2,
Derby,
Ant
and a SSL keystore for using HTTPS.
Installing the environment
Each student gets a zip-file name after the students user account to download from
this location. Download the zip-file and unpack it at a location
of your choosing on the computer you wish to use for the assignments.
If you are unable to find a zip-file with your username, contact the teachers on the course
as soon as possible - do NOT use someone elses package.
When unpacking this zip-file a directory structure containing a folder named 5dv076
is created.
This is the root folder for your laboration environment and contains (among others)
the following files:
5dv076/ <- Your laboration environment root folder
apache-ant-1.7.0/ <- Apache Ant (do not modify)
apache-tomcat-6.0.13/ <- Apache Tomcat
conf/ <- Apache Tomcat configuration directory
server.xml <- Apache Tomcat configuration file
username/
build.xml <- Ant build file for your web application
src/ <- place Java source code for your assignments here
update.bat <- update script for Windows environments
update-mac.sh <- - " - MacOS X environments
update.sh <- - " - UNIX / Linux environments
web/ <- web application source (JSP files etc)
assignment1/ <- place your solution to assignment 1 here
assignment2/ <- - " - 2 here
assignment3/ <- - " - 3 here
assignment4/ <- - " - 4 here
assignment5/ <- - " - 5 here
dist/ <- generated by the update scripts
username.war <- web application archive
index.jsp <- your web application first page
WEB-INF/
lib <- place (distributed) JAR-files for assignments here
where username is the students username.
Using the environment
When starting Tomcat (by running the update script), a web application archive named
username.war is created in the 5dv076/username/dist/ directory.
This web application automatically gets deployed into Tomcat (which is restared by the update
script) and you can access it through a web browser by surfing to the URL
http://localhost:8080/username
This web application archive is what you are required to hand in as solutions
to the assignments.
Note that one web application per student is created, not one per assignment.
So, in short: when developing the web pages:
- Edit the JSP pages in
5dv076/username/web
- Run the update script (the one selected for your operating system)
- Reload the web page in your browser
Installing Java
In order to use the laboration environment, your computer need to install
Java (version 1.5 or later).
If installing Java on your Windows PC, use
Suns Java JDK v1.6 update 1.
This is (at early June 2007) the latest version of Suns Java JDK.
Keep the default install path for Java:
C:\Program Files\Java\jdk1.6.0_01\
and use all other default values in the installation process as well.
Setting JAVA_HOME
The JAVA_HOME environment variable allows Tomcat to locate which version of Java to use.
The update scripts in the environment attempts to set JAVA_HOME to a predefined value
(/pkg/java on UNIX and
C:\Program Files\Java\jdk1.6.0_01 on Windows.
On MacOS X it is assumed to be set already).
If you have a different version of Java than 1.6u1, or have installed Java
under a non-default path you will have to update the JAVA_HOME portion in the update scripts.
The update scripts are just text files, simply replace the path on the JAVA_HOME line with the
path to your Java installation location.
NOTE: if you use the environment on the CS computers you will not need to install or
configure Java (as it is already installed)
Changing the Tomcat port
If you are using the laboration environment on a computer where someone else is already using
port 8080, you can alter the Tomcat configuration file and specify another port.
Simply search and replace 8080 by the port number you wish to use in the Tomcat
configuration file
(apache-tomcat-6.0.13/conf/server.xml ).
Note that you need to select a port number higher than 1023 on UNIX systems
(as they are reserved for the root user).
Updates
2007-06-14:
Due to an unforseen error, the ant build file (5dv076/username/build.xml )
in the environments will need to be updated if you have downloaded the environment
prior to 2007-06-14.
The simplest way of doing this is to open the file
5dv076/username/build.xml
in a text editor and paste the following five lines after the line containing the string
"j2ee.jar" .
----------------- snip -----------------
<pathelement location="web/WEB-INF/lib/assignment1.jar"/>
<pathelement location="web/WEB-INF/lib/assignment2.jar"/>
<pathelement location="web/WEB-INF/lib/assignment3.jar"/>
<pathelement location="web/WEB-INF/lib/assignment4.jar"/>
<pathelement location="web/WEB-INF/lib/assignment5.jar"/>
----------------- end snip -----------------
This update allows the build environment to include the assignment jars
in the web application when writing Java code directly (instead of in JSP).
Alternatively, you can download the environment anew,
and reinstall it (as all of the zip-files now contain this fix).
Note that if you reinstall the environment, you will naturally have to save your work and
copy the files you have worked on into the new environment manually.
HELP!!!
Having problems installing or using the environment?
Contact one of the teachers!
|