Directory /path/to/OG-Examples/./install/db/create/hsqldb does not exist


#1

I have cloned a copy of OG from git and managed to successfully build at the command line by typing ant build.
I am attempting to run the examples by running the shell script init-og-examples-db.sh, however this throws an exception.

Below is a stack trace from the console:

Creating empty database

Exception in thread “main” java.lang.IllegalArgumentException: Directory /home/morpheous/work/dev/java/OG-Platform/projects/OG-Examples/./install/db/create/hsqldb does not exist
at com.opengamma.util.ArgumentChecker.isTrue(ArgumentChecker.java:34)
at com.opengamma.util.test.DbTool.getScripts(DbTool.java:479)
at com.opengamma.util.test.DbTool.getScriptDirs(DbTool.java:541)
at com.opengamma.util.test.DbTool.createTables(DbTool.java:686)
at com.opengamma.util.test.DbTool.execute(DbTool.java:759)
at com.opengamma.util.test.DbTool.main(DbTool.java:845)
Exception in thread “main” java.lang.IllegalArgumentException: Directory /path/to/OG-Platform/projects/OG-Examples/./install/db/create/hsqldb does not exist
at com.opengamma.util.ArgumentChecker.isTrue(ArgumentChecker.java:34)
at com.opengamma.util.test.DbTool.getScripts(DbTool.java:479)
at com.opengamma.util.test.DbTool.getScriptDirs(DbTool.java:541)
at com.opengamma.util.test.DbTool.createTables(DbTool.java:686)
at com.opengamma.util.test.DbTool.execute(DbTool.java:759)
at com.opengamma.util.test.DbTool.main(DbTool.java:845)

Adding example data

Error: Could not find or load main class com.opengamma.examples.tool.ExampleDatabasePopulator

Completed


#2

Are you running the scripts from inside the OG-Examples project? The scripts are not designed to be run in place, but be bundled into an installation package.

To build an installation package run

ant install (at the top level)

which then creates a package directory called ‘opengamma’ in the OG-Platform root. This contains the actual deployment, which is the context in which the scripts need to run.

If you want to achieve the same thing in OG-Examples without doing that you can run:

ant new-hsqldb
ant init-database
ant jetty-debug

(the last step will run the engine and spool any logging output to the console, to fork the process and dump logs to a file, run ‘ant jetty’ instead or launch from Eclipse/IntelliJ)


#3

Thanks Jim. That solved the problem!


#4

Just to note that there are new instructions for the Maven based build of the new v2.0 release: http://docs.opengamma.com/display/DOC200/Building+the+source+code