且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将 PostgreSQL 数据源添加到 WildFly 9.0?

更新时间:2023-08-26 20:32:04

我遇到了与 WildFly 9 相同的错误和行为.我是 WF 的完全新手,但经过一些研究我发现问题是在模块命名中.如果我做得很好,模块中的实际包名称将用于解析 module.xml 的路径.
我已将步骤更改为以下步骤,并且有效:

module add --name=org.postgresql --slot=main --resources=/usr/local/lib/postgresql-9.4-1201.jdbc4.jar --dependencies=javax.api,javax.transaction.api

I've encountered the same error and behavior of WildFly 9. I'm a complete newbie to WF, but after some research I've found that the trouble is in the module naming. If I'm getting it well, the actual package names in the module are used to resolve the path to module.xml.
I've changed the steps to those below and it worked:

module add --name=org.postgresql --slot=main --resources=/usr/local/lib/postgresql-9.4-1201.jdbc4.jar --dependencies=javax.api,javax.transaction.api

/subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgresql",driver-class-name=org.postgresql.Driver)