https://jdbc.postgresql.org/download.html
Качаю:
postgresql-9.4-1201.jdbc41.jar
$ mkdir -p /u01/app/jboss/7.1.1/modules/org/postgresql/main
$ cp postgresql-9.4-1201.jdbc41.jar /u01/app/jboss/7.1.1/modules/org/postgresql/main
jboss
$ cp /u01/app/jboss/7.1.1/standalone/configuration/standalone.xml /u01/app/jboss/7.1.1/standalone/configuration/standalone.xml.orig
$ vi /u01/app/jboss/7.1.1/modules/org/postgresql/main/module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.postgresql">
<resources>
<resource-root path="postgresql-9.4-1201.jdbc41.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
$ vi /u01/app/jboss/7.1.1/standalone/configuration/standalone.xml
<datasources>
<datasource jta="false" jndi-name="java:/postgresDS" pool-name="postgresDS" enabled="true" use-ccm="false">
<connection-url>jdbc:postgresql://localhost:5432/mydatabase</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<driver>postgresql</driver>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>200</max-pool-size>
</pool>
<security>
<user-name>scott</user-name>
<password>tiger</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
<background-validation-millis>1</background-validation-millis>
</validation>
<statement>
<prepared-statement-cache-size>0</prepared-statement-cache-size>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
<drivers>
<driver name="postgresql" module="org.postgresql">
<xa-datasource-class>org.postgresql.Driver</xa-datasource-class>
</driver>
</drivers>
</datasources>
<drivers>
<driver name="postgresql" module="org.postgresql">
<xa-datasource-class>org.postgresql.Driver</xa-datasource-class>
</driver>
</drivers>
Ошибка:
Caused by: org.postgresql.util.PSQLException: FATAL: Ident authentication failed for user "scott" ...
Была по причине того, что неправильно были настроены правила в конфиге postgresql сервера. /var/lib/pgsql/data/pg_hba.conf
На тестовом окружении, я просто тупо поменял записи вида ident на trust. Все заработало.