The setup is needed when you want to use a different database. By default, the package provide the H2 database and does not need configuration.
The use of H2 database is described in the page [Database_connection]. The driver is already integrated in the current distribution.
This database is more suitable for production. Install the database server and ensure that this database will start as a service. For more instruction, consult the MySQL documentation. Don't forget to download the jdbc driver.
This database is suitable for developement and even production. You can find more on the site.
You need to create an empty database volunteerDB except for H2 database (auto creation). Consult the database documentation.
All the tables are created by the system, you don't need to run a script (this parameter should be disabled after the installation, see intruction below).
The driver must be inserted in distribution file (.war).
To configure, you need to decompress the war file as a zip file. Rename the extension of the file to .zip to decompress.
An excellent tool is 7-zip witch allow you to add, change, remove files directly without changing the extension, decompressing and recompressing (note: to edit correctly the Unix-like files, I have setup the 7-zip editor to the ConTEXT editor). Just rigth click VolunteerWeb.war and select open in 7-zip menu.
Remove unused drivers in the directory WEB-INF/lib. For example, remove debyclient.jar and h2.jar if you use MySQL. Insert the driver from MySQL by a drag and drop of the file in the 7-zip window.
[Image:volunteerWebWar.GIF]
Drivers tested :
After inserting the driver, you need to open the VolunteerJPA.jar file (first line in the picture above) in WEB-INF\lib directory and open META-INF and edit persistence.xml.
Find the lines :
<property name="toplink.jdbc.user" value="sa"/> <property name="toplink.jdbc.password" value=""/> <property name="toplink.jdbc.url" value="jdbc:h2:tcp://localhost/volunteerDB"/> <property name="toplink.jdbc.driver" value="org.h2.Driver"/>
Correct with your database user and password. Assuming your database is running on the same server, use the values below for the driver and url.
Important : it's better to remove the auto create table parameter in the persistence.xml file (see previous chapter to see how to open this file) after the first execution.
<property name="toplink.ddl-generation" value="create-tables"/> could be removed for better performance and to keep the sequence of id.
For more details, consult the TOMCAT documentation.
Install the Tomcat server and ensure that it start as a service.
You need to set a manager user and password to access the Manager tool. In the 'conf' folder of Tomcat installation, modify the file 'tomcat-user.xml'. For testing purpose, I set this line : <user username="tomcat" password="tomcat" roles="tomcat,admin,manager"/>.
For more information about user management, go to [usersAdministration users administration].
Start Tomcat and put this address in the address bar of your browser : [<http://localhost:8080/>] (note: the port is 8084 in the embedded Tomcat of NetBeans).
If your Tomcat installation is correct, you will see the Apache Tomcat main page.
On the Tomcat main page, click on Tomcat manager. Give the admin user and password (for exemple, with the previous defined example parameter tomcat / tomcat).
On the Deploy panel, select the war file to deploy, or if you have decompressed the war file, select the directory and click Deploy.
The VolunteerWeb application must appear on the Applications panel. Click on the left on the VolunteerWeb, you should enjoy the welcome page. :)
It is the simplest way to deploy the application. Stop the Tomcat web server, put the war file into the directory <INSTALLATION_DIR>\apache-tomcat-5.5.23\webapps (delete the old war file and the directory VolunteerWeb) and restart the server. Tomcat will auto deploy the application and expand the content in the VolunteerWeb directory.
Wiki: AdvancedInstallationGuide
Wiki: Database_connection
Wiki: Installation_guide