Could not find or load main class com.opengamma.component.tool.DbCreateTool


#1

I am trying to setup PostgreSQL but facing this class not found error. I am following the doc
http://docs.opengamma.com/display/DOC210/Database+initialisation

`
C:\\OG-Platform\\examples\\examples-simulated\\target\\scripts>db-create-tool.bat  -c classpath:dbtoolcontext/dbtoolcontext-example-postgres-fin.properties


"C:\\Program Files\\Java\\jdk1.7.0_25\\bin\\java" -Xms512m -Xmx1024m -XX:PermSize=128
M -XX:MaxPermSize=256M -XX:+UseParallelGC -XX:+UseParallelOldGC -cp "C:\\Users\\Mu
dit\\Documents\\Projects\\OpenGamma\\Code\\OG-Platform\\examples\\examples-simulated\\ta
rget\\scripts\\..\\config;C:\\Users\\Mudit\\Documents\\Projects\\OpenGamma\\Code\\OG-Platf
orm\\examples\\examples-simulated\\target\\scripts\\..\\lib\\examples-simulated-2.2.0-S
NAPSHOT.jar;" com.opengamma.component.tool.DbCreateTool -c classpath:dbtoolconte
xt/dbtoolcontext-example-postgres-fin.properties -l com/opengamma/util/warn-logb
ack.xml

Error: Could not find or load main class com.opengamma.component.tool.DbCreateTool


`


Getting error: Could not find or load main class DbCreateTool
#2

You need to be running that script from within target/server-dir/scripts, not target/scripts


#3

It looks like you are running the scripts from the wrong folder. The “examples-simulated/target/scripts” folder is a temporary work area used while creating the build. Scripts will not work in there.

The standard maven build creates a full unpacked installation in “examples-simulated/target/server-dir”, and it is the scripts in there that you should run. You may wish to move that folder out of “target” to simplify development.

http://docs.opengamma.com/display/DOC210/Working+with+the+source+code


#4

Thanks, now I am able to run the script. But its throwing error for the following line
MANAGER.NEXT.FILE = classpath:dbtoolcontext/dbtoolcontext.ini

I do not have any dbtoolcontext.ini file in server-dir/config/dbtoolcontext folder. Is it automatically added by maven? or do I need to write it on my own? how do I write this?


#5

Here is an example you can use:
https://github.com/OpenGamma/OG-Platform/blob/develop/deployment-template/config/dbtoolcontext/dbtoolcontext.ini