v4.5 with mssql database
I am trying to upgrade Corda node from v4.3 to v4.5. The node is using Microsoft SQL Server. It worked fine on v4.3. However, it hits an error on v4.5 during startup:
E 13:53:25+0000 [main] internal.NodeStartupLogging. - Failed to create the datasource: Migration failed for change set migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda: Reason: net.corda.nodeapi.internal.persistence.HibernateConfigException: Could not create Hibernate configuration: Failed to find a SessionFactoryFactory to handle jdbc:sqlserver://x.x.x.x:1433;sslProtocol=TLS;jaasConfigurationName=SQLJDBCDriver;statementPoolingCacheSize=0;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=30;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=x;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; - factories present for [H2, PostgreSQL]. See the logs for further information and the cause. [Error Code: database-failed-startup For further information, please go to https://docs.corda.net/docs/corda-os/4.5/error-codes.html] {}
Node configuration:
dataSourceClassName = "com.microsoft.sqlserver.jdbc.SQLServerDataSource" dataSource.url = "jdbc:sqlserver://[HOST]:[PORT];databaseName=[DATABASE_NAME]" dataSource.user = [username] dataSource.password = [password] } jarDirs = ["/opt/corda/drivers"] database = { transactionIsolationLevel = READ_COMMITTED }
And there is jdbc driver jar 6.4 in /opt/corda/drivers directory.
I noticed Microsoft SQL Server seems missing here, could it be a problem? https://github.com/corda/corda/tree/release/os/4.5/node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/factory
Thanks so much.
Automatically created Jira issue: CORDA-4022
I am having this same issue with cordform task for SQLServer, @sachingokhale - any update on this?
Task
// Task to deploy the nodes in order to bootstrap a network using Postgres DB
task deployNodesSQLServer(type: Cordform, dependsOn: ['jar']) {
nodeDefaults {
projectCordapp {
deploy = false
}
cordapp project(':contracts')
cordapp project(':workflows')
}
node {
name "O=EA_CRM,L=London,C=GB"
p2pPort 10005
rpcSettings {
address("localhost:10006")
adminAddress("localhost:10046")
}
runSchemaMigration = false
rpcUsers = [[user: "user1", "password": "test", "permissions": ["ALL"]]]
extraConfig = [
'dataSourceProperties.dataSourceClassName': 'com.microsoft.sqlserver.jdbc.SQLServerDataSource',
'dataSourceProperties.dataSource.url' : 'jdbc:sqlserver://localhost:1433;databaseName=master',
'dataSourceProperties.dataSource.password': 'XXXXXX',
'dataSourceProperties.dataSource.user' : 'node_login']
drivers = ['./database/driver/mssql-jdbc-6.4.0.jre8.jar']
}
}
Error in the node logs
05-21T05:16:23,362Z [main] internal.NodeStartupLogging. - Failed to create the datasource: Migration failed for change set migration/vault-schema.changelog-v9.xml::update-vault-states::R3.Corda:
Reason: net.corda.nodeapi.internal.persistence.HibernateConfigException: Could not create Hibernate configuration: Failed to find a SessionFactoryFactory to handle jdbc:sqlserver://localhost:1433;sslProtocol=TLS;jaasConfigurationName=SQLJDBCDriver;statementPoolingCacheSize=0;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=30;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=master;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; - factories present for [H2, PostgreSQL]. See the logs for further information and the cause.
[Error Code: database-failed-startup For further information, please go to https://docs.corda.net/docs/corda-os/4.7/error-codes.html]
this problem been solved?
Probably too late on this, but the reason for the issue is that SQLServer is only supported by Corda enterprise, so you need to change cordaReleaseGroup=com.r3.corda (instead of net.corda ) and ensure that you have the enterprise Corda jars in your m2 folder