I am trying to build a new cordapp. And the build is failing for one of my nodes creation, below is the stacktrace in the node respective log
[1;31m[ERROR] 09:25:18+0530 [main] spi.SqlExceptionHelper.logExceptions - ERROR: relation "hibernate_sequence" does not exist
Position: 17
[m[1;31m[ERROR] 09:25:19+0530 [main] internal.Node.run - Exception during node startup
[m javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:162) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:886) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:860) ~[hibernate-core-5.2.6.Final.jar:5.2.6.Final]
at net.corda.node.services.network.PersistentNetworkMapCache.updateInfoDB(PersistentNetworkMapCache.ktI247) ~[corda-node-3.3-corda.jar:?]
If i create hibernate_sequence
in the db directly then i do not see this error. This error occurs with Postgres DB.
The postgres driver is added in the build.gradle as,
implementation("org.postgresql:postgresql:42.1.4")
The node is configured to use postgres by updating task deployNodes() in build.gradle for the corresponding node, example,
node {
name "O=LedgerApp,L=London,C=GB"
......
extraConfig = [
'dataSourceProperties': [
'dataSourceClassName': 'org.postgresql.ds.PGSimpleDataSource',
'"dataSource.url"' : 'jdbc:postgresql://localhost:5432/postgres?currentSchema=appschema',
'"dataSource.user"' : 'corda',
'"dataSource.password"': 'corda'
],
'database' : [
'transactionIsolationLevel': 'READ_COMMITTED'
]
]
}
Corda version used is 3.3-corda.