Introduction: -------------------------------------------------------------------------- Make sure you've gotten: MySQL 4.0.18 Java SDK SE 1.4.2 (.04) from java.sun.com Tomcat 5.0.19 binaries from jakarta.apache.org Eclipse Stream M8 from www.eclipse.org Sysdeo Tomcat Plugin 2.2.1 from www.sysdeo.com/eclipse/tomcatPlugin.html Installation order is as follows: Install the Java SDK. Install Tomcat. Extract Eclipse. Extract the Tomcat plugin into the eclipse/plugins directory. CVS Tips in Eclipse: -------------------------------------------------------------------------- Run Eclipse 3.0 Stream. Make sure you have the Tomcat plugin installed (it's functional in 3.0). Know where your default workspace is so that you know where Eclipse is placing your new CVS projects. Change your view to the CVS repository perspective. Right click in the left window pane and click New -> Repository Location Host: stdsun.cis.ohio-state.edu Repository path: /project/c758aa02/Repository Enter your CIS username and password. Change the connection type to extssh. Connect and you should be good to go. Now, expand the repository and its HEAD folder. Right click on the root of BERefereeScheduler (as of writing) way over in the upper left and click "Check Out". Eclipse will have a little progress meter in the lower right. When the update finishes, switch to Java view. This is where the editing takes place. Eclipse will automatically begin building the project once it's open. Since the BERefereeScheduler is a Tomcat web application, all of the resultant .class files can be found in /WEB-INF/classes When you use jsp pages, it's necessary that Tomcat is able to compile the .jsps into actual Java class files. In order to ensure that the compiler is part of the classpath, copy your Java SDK's "/lib/tools.jar" into your Tomcat install's "/common/lib/tools.jar". If, after finishing the following installation steps, your web browser display a stack trace of an exception saying that it cannot find the proper compiler, then this is your problem. The error suggests this fix. Eclipse: -------------------------------------------------------------------------- So you've the project now, but there are more configuration issues. First, make sure that your Tomcat Plugin is installed. Go to the Window menu -> Preferences -> Tomcat, and set the Tomcat version to 5.X. Then fill in the Tomcat home and base addresses to wherever you installed Tomcat: i.e. F:\Program Files\Apache Software Foundation\Tomcat 5.0 (The plugin will automagically set the configuration file path for you.) Then say OK and go back to the project. If Eclipse has Problems compiling the project, make sure that all of the JARs are in the classpath. (This isn't always an easy task, as the missing classes could be in any one of many possible JAR files. It's most important to remember which type of class cannot be found. This way it's easier to find the associated JARs in the lib directories.) It's necessary to find these JARs and include them in the project classpath. Right click on the BERefereeScheduler project and do properties. Go to the Java Build Path. Click the Add External Jars button that's on the right of the form window, and browse your system to find the location of these jars (the may be in your /common/lib directory in the Tomcat root.) Once these three jars are added, remove the old, bad jar references if they're still there. Regardless, go to the Java Perspective and right-click on the MosslRefereeScheduler project. Go to Tomcat Project and click create JSP working directory. This is where the JSP pages are compiled to when the page is used. MySQL: -------------------------------------------------------------------------- Once you get the CVS repository loaded, you need to set up your database with the proper tables. The easiest way to accomplish this is to open the build file within Eclipse. Make sure that the Window->Views->Ant view is enabled, and click the yellow pluses icon in the Ant view (probably on the upper-right portion of Eclipse). This adds the build files for Eclipse to watch. Select the WEB-INF/src/build.xml file as the ant script to load. With the Ant script loaded, each of the tasks and properties in the script will appear in the Ant view. Look for the: exportDDLtoFile overwriteDDLinDB updateDDLinDB loadJunkDataintoDB Targets in the Ant view. These will (mostly) handle the database tasks for you. The tables needed to support the Referee Scheduler can be generated from the exportDDLtoFile target. This creates the mossl-schema-export.ddl file which is located in the project root directory. (CVS will import the project to the default location that Eclipse uses. In your filesystem, NOT IN ECLIPSE, navigate to Eclipse's workspace directory that is specified each time that Eclipse is executed, and then open the /BERefereeScheduler/WEB-INF and you will see the DDL file.) Since InnoDB files are required for transaction support in MySQL, it's necessary to modify this DDL file by appending "type=InnoDB" before the ; at the end of each CREATE statement. i.e.: CREATE TABLE GAME (.....)type=InnoDB; This modification is necessary to ensure transaction support on the MySQL server. Copy mossl-schema-export.dll to MySQL's /bin directory. Then open a terminal window and navigate to mysql's /bin and run mysql -u root -p (Go here: http://dev.mysql.com/doc/mysql/en/Post-installation.html if you've not done anything to configure your MySQL server.) Hopefully you've setup a root password, otherwise anyone can alter your DB. Ok, now that you're in the mysql console, make sure you've done something like: create database test; Now go into this database: use test; Just to make sure that everything worked out ok. Now, if you created the database test as shown before, you want to grant access to outside users. Do this like so: grant all privileges on test.* to blue@"%" identified by 'elephant'; Back in Eclipse, if you open up the Ant view and click the yellow plus signs so that the /WEB-INF/src/build.xml file is specified, you can automatically load your MySQL database with some junk data. First execute the overwriteDLLinDB task. The Eclipse console should flash some blue stuff. Then execute the loadJunkDataintoDB task, which will load the contents of junkdata.sql into the database. Viewing the Page: -------------------------------------------------------------------------- Now open up a web-browser. Open location: http://localhost:8080/BERefereeScheduler Enter valid referee data: User : et01 Password: pword Or valid administrator data: User : root Password: pword ...and away you go. mcconnet@cis.ohio-state.edu April 26, 2004 Revised May 10, 2004 Revised June 5, 2004