Newer
Older
Setting up latest OpenOLAT version on Eclipse
-------------------------------------------------------------------------

gnaegi
committed
o As the latest development is often ahead of the current documentation you will always find an up to date
install guide here.
*******************************************************************************************
Setting up OpenOLAT in Eclipse
*******************************************************************************************
Preconditions:
o Check that you are using maven 2.2 or higher (mvn -V)
o Check that you have the mercurial plugin installed in eclipse (http://www.javaforge.com/project/HGE)
o Check that you have Mercurial (hg) installed
o MySQL 5.1 or greater or PostreSQL 8.4
1. In Eclipse: create a Mercurial repository location (http://hg.openolat.org/openolat) and clone the repo.

gnaegi
committed
1.1 Do not add a password and make sure you uncheck the init Mercurial repo checkbox at the end. Right
click to clone repo into your workspace.
2. Setup Eclipse Environment
2.1 If M2_REPO Eclipse variable is missing then execute in terminal:
mvn -Declipse.workspace=<location of your workspace> eclipse:configure-workspace
2.2 In terminal: create eclipse project settings and create .classpath file by running
mvn eclipse:clean eclipse:eclipse
3. In Eclipse: refresh the project.
4. Create an olat.local.properties file somewhere

gnaegi
committed
4.1 Copy the olat.local.properties.sample to olat.local.properties in the project root folder
4.2 Adjust the file to match your setup. See the comments in the file header for more configuration options.
4.3 Right click on the file src/main/java/olat.local.properties in our eclipse project to open the file
properties and link it to your own olat.local.properties you created in step 4.1.
5. In Eclipse: refresh the project again.
5.1 Make sure the project compiled without errors. Warnings are ok.
5.2 If the project did not compile you have to fix the problems before you proceed. See Troubleshooting below.
6. Prepare database permissions and initialize the database
6.1.a. In MySQL create a user 'openolat' and a database 'openolat'

gnaegi
committed
CREATE DATABASE IF NOT EXISTS openolat;
GRANT ALL PRIVILEGES ON openolat.* TO 'openolat' IDENTIFIED BY 'openolat';
UPDATE mysql.user SET HOST='localhost' WHERE USER='openolat' AND HOST='%';
FLUSH PRIVILEGES;
6.1.b. Alternatively you can use a helper script to create the MySQL database user and the empty database:

gnaegi
committed
scripts/dbAndUserSetup.sh
6.1.c. PostgreSQL users please check their PostgreSQL manual how to create a user and database
6.2 Write the OpenOLAT database schema to the OpenOLAT database. Example for MySQL:

gnaegi
committed
mysql -u openolat -p openolat < src/main/resources/database/mysql/setupDatabase.sql
6.3 Optional: if you want to run the jUnit tests, make sure you also create and initialize the test database
that you configured in src/test/profile/mysql/olat.eclipse.properties
7. In Eclipse: setup tomcat server by clicking on olat->Run As->"Run on Server".
7.1 The Run on Server wizard will pop up and check: manually define a new server
7.2 look for Apache->Tomcat v6.0 or v7.0 Server
7.3 Add openolat as web application in the step "Add and remove" and click finish
7.4 Double click the newly created server and increase the timeout to something like 180s
7.5 Open the launch configuration of the server, select the tab Arguments and add these arguments to the VM arguments:
-XX:MaxPermSize=128m -Xms128m -Xmx384m -Djava.awt.headless=true
7.6 Open the generated server.xml file and manually set the following parameters:
In the "Context" element set parameter reloadable="false"
In all "Connector" elements set paramter URIEncoding="UTF-8"
8. In Eclipse: start the server
9. In your browser open URL http://localhost:8080/olat
You can log in with user "administrator" and password "openolat"
10. Have fun, give feedback and contribute!
*******************************

gnaegi
committed
A. OutOfMemoryException: in Eclipse: setup VM arguments by clicking on
Run > Run Configurations > Arguments > VM Arguments and pasting:
-Xmx384m -Xms128m -XX:MaxPermSize=128m -Djava.awt.headless=true

gnaegi
committed
B. (optional) Create an empty olat.local.properties and save it to /yourTomcatDir/lib (OLAT searches for
this file on the classpath and /tomcat/lib is part of it). But OLAT should start with just the default config!

gnaegi
committed
D. Usually you will get a timeout exception when you start a new OLAT. After double clicking on the server entry
you can increase the timeout for the startup.

gnaegi
committed
E. If your tomcat starts very quickly but you cannot access OLAT it might be that tomcat did not find the OLAT
context. Right click the server entry and click publish to inform eclipse about a new or updated context.

gnaegi
committed
F. If you run into problems with classes or resources not found e.g. "ClassNotFoundException" right click your
server config and run the "Clean..." Task to republish all resources. Problems comes mostly when switching
from eclipse to console and back with command like mvn clean, or eclipse clean and such. You will always get
a clean and working environment when you do the following: Eclipse clean, create eclipse settings with launch,
Server publish resources and restart OLAT.
Background (optional for further interest)
------------------------------------------------------------------

gnaegi
committed
o There is only one spring context for the whole OpenOLAT which you can access via CoreSpringFactory. The context
is configured with the files serviceconfig/olat.properies and can be overwritten with olat.local.properties.
changes in olat.local.properties are reflected upon each restart of Tomcat.