Newer
Older
Setting up latest OpenOLAT version on Eclipse
-------------------------------------------------------------------------
o As the latest development is often ahead of the current documentation you will always find an up to date install guide here.
o There a two different arts to install a development environment for OpenOLAT. Choose the one you prefer.
*******************************************************************************************
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.
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. 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
4.1 Right click on olat.local.properties in our eclipse project (src/main/java) and link it to your own olat.local.properties. You can customized
your configuration whit this file. You can find an example in root of your eclipse project: olat.local.properties.sample
5. In MySQL create a user 'olat' and a database 'olat'
CREATE DATABASE IF NOT EXISTS olat;
GRANT ALL PRIVILEGES ON olat.* TO 'olat' IDENTIFIED BY 'olat';
UPDATE mysql.user SET HOST='localhost' WHERE USER='olat' AND HOST='%';
FLUSH PRIVILEGES;
mysql -u olat -p olattest < src/main/resources/database/mysql/setupDatabase.sql
6. In Eclipse: setup tomcat server by clicking on olat->Run As->"Run on Server".
6.1 The Run on Server wizard will pop up and check: manually define a new server
6.2 look for Apache->Tomcat v6.0 or v7.0 Server
6.3 Add openolat as web application in the step "Add and remove" and click finish
6.4 Double click the newly created server and increase the timeout to something like 180s
6.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. In Eclipse: start the server
*******************************
Troubleshotting
*******************************
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
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!
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.
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.
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)
------------------------------------------------------------------
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.