... Corda deployNodes失败。日志显示:
[错误] 2018-10-04T11:16:05,466Z [main] util.PropertyElf.setProperty- 无法在目标类别上设置属性url org.postgresql.ds.PGSimpleDataSource {} java.lang.reflect.InvocationTargetException:空 在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)〜[?:1.8.0_181] 在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 〜[?:1.8.0_181] 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 〜[?:1.8.0_181] 在java.lang.reflect.Method.invoke(Method.java:498)〜[?:1.8.0_181] 在com.zaxxer.hikari.util.PropertyElf.setProperty(PropertyElf.java:146) 〜[HikariCP-2.5.1.jar :?] 在com.zaxxer.hikari.util.PropertyElf.lambda $ setTargetFromProperties $ 0(PropertyElf.java:57) 〜[HikariCP-2.5.1.jar :?] 在java.util.Hashtable.forEach(Hashtable.java:879)[?:1.8.0_181] 在com.zaxxer.hikari.util.PropertyElf.setTargetFromProperties(PropertyElf.java:52) [HikariCP-2.5.1.jar :?] 在com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:315) [HikariCP-2.5.1.jar :?] 在com.zaxxer.hikari.pool.PoolBase。(PoolBase.java:108)[HikariCP-2.5.1.jar :?] 在com.zaxxer.hikari.pool.HikariPool。(HikariPool.java:99) [HikariCP-2.5.1.jar :?] 在com.zaxxer.hikari.HikariDataSource。(HikariDataSource.java:71) [HikariCP-2.5.1.jar :?] 在net.corda.node.internal.DataSourceFactory.createDataSource(DataSourceFactory.kt:38) [corda-node-3.2-corda.jar :?] 在net.corda.node.internal.DataSourceFactory.createDataSource $ default(DataSourceFactory.kt:35) [corda-node-3.2-corda.jar :?] 在net.corda.node.internal.AbstractNodeKt.configureDatabase(AbstractNode.kt:910) [corda-node-3.2-corda.jar :?] 在net.corda.node.internal.AbstractNode.initialiseDatabasePersistence(AbstractNode.kt:680) [corda-node-3.2-corda.jar :?] 在net.corda.node.internal.Node.initialiseDatabasePersistence(Node.kt:345) [corda-node-3.2-corda.jar :?] 在net.corda.node.internal.AbstractNode.start(AbstractNode.kt:206) [corda-node-3.2-corda.jar :?] 在net.corda.node.internal.Node.start(Node.kt:359)[corda-node-3.2-corda.jar :?] 在net.corda.node.internal.NodeStartup.startNode(NodeStartup.kt:145) [corda-node-3.2-corda.jar :?] 在net.corda.node.internal.NodeStartup.run(NodeStartup.kt:115)处[corda-node-3.2-corda.jar :?] 在net.corda.node.Corda.main(Corda.kt:13)[corda-node-3.2-corda.jar:?]
答案 0 :(得分:1)
dataSourceProperties = {
“ dataSourceClassName”:org.postgresql.ds.PGSimpleDataSource
“ dataSource.url”:“ jdbc:Postgresql://127.0.0.1:5432 / postgres”
“ dataSource.user”:“ USER”
“ dataSource.password”:“ PASSWORD”
}
数据库= {
transactionIsolationLevel = READ_COMMITTED
架构=公证人
}
答案 1 :(得分:0)
我遇到了同样的问题,解决方案是使用以下格式以node.conf
重写数据库属性:
"dataSourceProperties.dataSourceClassName"=org.postgresql.ds.PGSimpleDataSource
"dataSourceProperties.dataSourceClassName"
与dataSourceProperties.dataSourceClassName
的区别对待(无引号)似乎是一个问题。
答案 2 :(得分: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. :)