Could not run OG-Example simulated with hts in postgresql


I use the latest github master branch download and

changed config/toolcontext/ hts part as

db.hts.dialect = com.opengamma.util.db.PostgresDbDialect
db.hts.driver = org.postgresql.Driver
db.hts.url = jdbc:postgresql://
db.hts.username = opengamma
db.hts.password = opengamma

The db og_financial is accessible via commad psql -h -d og_financial -U opengamma
(where my db should reside)
mvn install -DskipTests

./scripts/ in the server-dir and I get

17:43:00,618 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [BRIDGE] to Logger[ROOT]
17:43:00,618 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
17:43:00,619 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5e8caa63 - Registering current configuration as safe fallback point

com.opengamma.OpenGammaRuntimeException: Failed to init component factory: ‘dbHtsMaster’ with {factory=com.opengamma.component.factory.master.DbHistoricalTimeSeriesMasterComponentFactory, classifier=tool, dbConnector=::hts}
at com.opengamma.component.ComponentManager.initComponent(
at com.opengamma.component.ComponentManager.initComponents(
at com.opengamma.component.ComponentManager.init(
at com.opengamma.component.ComponentManager.start(
at com.opengamma.component.ComponentManager.start(
at com.opengamma.component.tool.ToolContextUtils.getToolContext(
at com.opengamma.component.tool.ToolContextUtils.getToolContext(
at com.opengamma.examples.simulated.tool.ExampleDatabaseCreator.main(
Caused by: com.opengamma.OpenGammaRuntimeException: Unable to find current hts schema version in database
at com.opengamma.component.factory.master.AbstractDbMasterComponentFactory.checkSchemaVersion(
at com.opengamma.component.factory.master.AbstractDbMasterComponentFactory.checkSchema(
at com.opengamma.component.factory.master.DbHistoricalTimeSeriesMasterComponentFactory.init(
at com.opengamma.component.ComponentManager.initFactory(
at com.opengamma.component.ComponentManager.initComponent(
… 10 more


any clue?


That looks like the schema hasn’t been created correctly. Does the og_financial database have any tables in it when you look at it?


I was going in an assumption that the exampleDataBaseCreator would do it during init script.


I have run the sql file psql -h -d og_financial -U opengamma -f projects/OG-MasterDB/src/main/resources/db/create/postgres/hts/V_45__create_hts.sql

now the tables are in the database

still I am getting the same error when running init script


Running the class examples simulated ExampleDatabaseCreator from an IDE should correctly setup the database using the file /toolcontext/ That class automatically calls ExampleDatabasePopulator to populate the data. And the script calls ExampleDatabaseCreator (without the need for an IDE).

The script may be failing now because you already have some tables created (although it is supposed to just delete them and recreate them. Have you tried deleting the database and starting again?


One problem is that postgresql does not like underscores in the database name.


I have some property files that work on my postgresql server.