如何将PostgreSQL数据源添加到WildFly 9.0? [英] How to add PostgreSQL datasource to WildFly 9.0?

查看:435
本文介绍了如何将PostgreSQL数据源添加到WildFly 9.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 mastertheboss尝试过教程.com


  1. ./ jboss-cli.sh

  2. module add --name = org.postgres --resources = / tmp / postgresql-9.3-1101.jdbc41.jar --dependencies = javax.api,javax .transaction.api

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

  4. data-source add --jndi-name = java:/ PostGreDS --name = PostgrePool --connection-url = jdbc:postgresql:// localhost / postgres --driver-name = postgres --user-name = postgres --password = postgres

  1. ./jboss-cli.sh
  2. module add --name=org.postgres --resources=/tmp/postgresql-9.3-1101.jdbc41.jar --dependencies=javax.api,javax.transaction.api
  3. /subsystem=datasources/jdbc-driver=postgres:add(driver-name="postgres",driver-module-name="org.postgres",driver-class-name=org.postgresql.Driver)
  4. data-source add --jndi-name=java:/PostGreDS --name=PostgrePool --connection-url=jdbc:postgresql://localhost/postgres --driver-name=postgres --user-name=postgres --password=postgres

本教程适用于WildFly 8.2,但它不适用于WildFly 9.0。第3步失败并显示错误消息:

This tutorial works with WildFly 8.2, but it doesn't work with WildFly 9.0. 3rd step fails with error message:

{
"outcome" => "failed",
"failure-description" => "WFLYJCA0041: Failed to load module for driver [org.portgres]",
"rolled-back" => true
}

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

How to add Postgres datasource to WildFly 9.0?

推荐答案

我遇到了与WildFly 9相同的错误和行为。我是WF的完全新手,但经过一些研究我发现麻烦在于模块命名。
如果我搞定了,模块中的实际包名称将用于解析module.xml的路径。

我已将步骤更改为以下内容并且有效:


模块添加--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)

这篇关于如何将PostgreSQL数据源添加到WildFly 9.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆