3

... corda deployNodes fails. The log shows:

[ERROR] 2018-10-04T11:16:05,466Z [main] util.PropertyElf.setProperty - Failed to set property url on target class org.postgresql.ds.PGSimpleDataSource {} java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181] at com.zaxxer.hikari.util.PropertyElf.setProperty(PropertyElf.java:146) ~[HikariCP-2.5.1.jar:?] at com.zaxxer.hikari.util.PropertyElf.lambda$setTargetFromProperties$0(PropertyElf.java:57) ~[HikariCP-2.5.1.jar:?] at java.util.Hashtable.forEach(Hashtable.java:879) [?:1.8.0_181] at com.zaxxer.hikari.util.PropertyElf.setTargetFromProperties(PropertyElf.java:52) [HikariCP-2.5.1.jar:?] at com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:315) [HikariCP-2.5.1.jar:?] at com.zaxxer.hikari.pool.PoolBase.(PoolBase.java:108) [HikariCP-2.5.1.jar:?] at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:99) [HikariCP-2.5.1.jar:?] at com.zaxxer.hikari.HikariDataSource.(HikariDataSource.java:71) [HikariCP-2.5.1.jar:?] at net.corda.node.internal.DataSourceFactory.createDataSource(DataSourceFactory.kt:38) [corda-node-3.2-corda.jar:?] at net.corda.node.internal.DataSourceFactory.createDataSource$default(DataSourceFactory.kt:35) [corda-node-3.2-corda.jar:?] at net.corda.node.internal.AbstractNodeKt.configureDatabase(AbstractNode.kt:910) [corda-node-3.2-corda.jar:?] at net.corda.node.internal.AbstractNode.initialiseDatabasePersistence(AbstractNode.kt:680) [corda-node-3.2-corda.jar:?] at net.corda.node.internal.Node.initialiseDatabasePersistence(Node.kt:345) [corda-node-3.2-corda.jar:?] at net.corda.node.internal.AbstractNode.start(AbstractNode.kt:206) [corda-node-3.2-corda.jar:?] at net.corda.node.internal.Node.start(Node.kt:359) [corda-node-3.2-corda.jar:?] at net.corda.node.internal.NodeStartup.startNode(NodeStartup.kt:145) [corda-node-3.2-corda.jar:?] at net.corda.node.internal.NodeStartup.run(NodeStartup.kt:115) [corda-node-3.2-corda.jar:?] at net.corda.node.Corda.main(Corda.kt:13) [corda-node-3.2-corda.jar:?]

3 Answers 3

1

dataSourceProperties = {
"dataSourceClassName" : org.postgresql.ds.PGSimpleDataSource
"dataSource.url" : "jdbc:Postgresql://127.0.0.1:5432/postgres"
"dataSource.user" : "USER"
"dataSource.password" : "PASSWORD"
}
database = {
transactionIsolationLevel = READ_COMMITTED
schema = Notary
}

Sign up to request clarification or add additional context in comments.

Comments

0

I had the same problem and solution was to rewrite database properties in node.conf using the following format:

"dataSourceProperties.dataSourceClassName"=org.postgresql.ds.PGSimpleDataSource

It seems to be an issue where "dataSourceProperties.dataSourceClassName" is treated differently to dataSourceProperties.dataSourceClassName (no quotes).

1 Comment

This is a Corda 3.X bug and will be fixed in Corda 4.
0
I tried alot and Finally I got solution. Again solution is based on type of Datasource and its version.
The root cause of this issue is PGSimpleDataSource does not have "url" property but other properties are there to form URL such as serverName, portNumber, DataBaseName. We did not specify those property because we specify URL that is incorrect for PGSimpleDataSource.

Solution:
remove url property of datasource 
// datasource..addDataSourceProperty(("url", databaseProp.getUrl()))

Add following things in place of URL.
    dataSource.addDataSourceProperty("serverName", "HOSTName/IP");
        //dataSource.addDataSourceProperty("serverName", "localhost");
        dataSource.addDataSourceProperty("portNumber", "5432");
        dataSource.addDataSourceProperty("databaseName", "testDB");

its is working fine after struggling a lot. :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.