Skip to content

Guide to getting QTIEngine to run in Grails 2.1.1

Fri 25th October 2013

I have recently been trying to get QTIEngine into an environment where I can develop it, as there are a few bugs I’d like to fix (e.g. returning hard-coded links to JS and CSS on qtiengine.qtitools.org and stripping out all the useful whitespace from <pre> tags). However, it is a pain in the bloody arse, so I thought I’d record some information and tips here.

Building from Source

The QTIEngine wiki page is excellent. It is still mostly correct. For posterity (as it seems to be being slowly spamdalized):

Brief instructions for building from source

  • install grails (the latest version should be OK — development began with 1.0.3 and we currently build against 1.2.1)
  • install maven2
  • get code from the Sourceforge SVN repository (all of the /trunk/projects directory)
  • run “mvn package install” in each of the dependency directories (JQTI, JQTI-Rendering, JQTI-Controller, QTItoolsUtils [in this order…])
  • in the QTIEngine directory:
    • the first time only: “grails upgrade” (answer yes to everything)
    • then
      • “grails run-app” (to run in dev mode – sets up a jetty instance on port 8080) or
      • “grails war” (to generate a war file for deployment to tomcat, etc)

Logging

The default QTIEngine logging configuration is a bit confusing for a Grails and log4j newbie, and does not help debug anything. My advice is to comment out everything within log4j { } in grails-app/conf/Config.groovy. Then you at least see all errors on stderr. It may also help QTIEngine run by avoiding errors related to either a different version of log4j or the file permissions on the log files (  couldn’t work out which was the real problem).

Database

Since Grails 2.0, H2 has replaced HSQLDB. To tell it HSQLDB is still a dependency, at the following to the dependecies section of your grails-app/conf/BuildConfig.groovy file:

// Add HSQLDB as a runtime dependency
runtime 'hsqldb:hsqldb:1.8.0.10'

Running

I recommend getting the jetty plugin for grails rather than tomcat. I did:

grails uninstall-plugin tomcat
grails install-plugin jetty

I advise running grails first, to get the interactive prompt, then run the program by typing run-app. Seems to give better debug messages (rather than just failing silently as grails run-app does).

Server Name

QTIEngine serves the wrong server names in various places. This makes it break. I’ve noticed there’s a grails.serverURL in environments.production/development section of grails-app/conf/Config.groovy that points to localhost:8080 and qtiengine.qtitools.org. These are clearly the culprit, and will be where I start my investigation! It is also a quick fix for getting QTIEngine running (replace it with your server URL)!

Working?

Not yet. The front page loads, and I can upload a file, but it 404s with no error output. Where is stderr going? I’m going to have to fiddle with the logging some more, aren’t I? Check back for edits 🙂

Advertisements
One Comment

Trackbacks & Pingbacks

  1. How to successfully edit QTIEngine | Rikki Rants

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: