Installation server - t0tec/racing-2D GitHub Wiki

Installation server

Dependencies

  • Java 7 or higher
  • Maven (version 2 or higher)
  • Perl
  • MySQL/MariaDB 5.6.x or higher
  • Netbeans Java EE or Eclipse Java EE
  • Tomcat Server 7.0.x (not included in Eclipse, included in Netbean Java EE)

Install Tomcat for Eclipse

Link

Configure application

You'll need to adjust the datasource.properties file located in racingConfig so the application can connect to your database.

Example: for local use:

development.url=jdbc:mysql://localhost:<port MySQL>/<Database-name>
development.user=<MySQL-login>
development.password=<MySQL-password>

You can also easily configure to connect to which datasource you want:

Spring's ApllicationContext to define the datasources and DaoFactory.java to which datasource you want to connect

To fill database with data

For now I have used Perl script to execute an SQL script to reset and recreate my database.

You 'll need to have Perl installed and the Perl modules perl-dbi,perl-dbd-mysql and SQL::SplitStatments. To run the script you'll need to do change the configuration in the script.

Example:

$config{host} = "localhost";
$config{port} = 3306;
$config{user} = "root"; # MySQL login
$config{password} = "root"; # MySQL password

Just simply run in commandline: perl resetdb.pl to execute the script.

I'll try to make a Java solution later on without the need of Perl.

To run database unit tests

To carry out the database unit test, navigate in command line to the webapp/racing/racingDomain directory and run mvn clean compile test.

If you experience a problem with maven (Failed to collect dependencies) than try out this command: mvn clean install followed by mvn test

To run the application on your Tomcat server

  1. Open Netbeans or Eclipse and start your Tomcat server
  2. First run the racingAPI module on your tomcat server, than run the racingWeb module on your server
  3. Navigate to http://localhost:8080/racingWeb/ to start the web client

NOTE: If you experience a problem with the API than you probably need to change the context path in Eclipse to api. See this link.

Also set the context path of racingWeb client at / (root) of your Tomcat Server.

⚠️ **GitHub.com Fallback** ⚠️