JBoss 7.1.1 won't deploy PostgreSQL driver
g.i.joe Jul 19, 2012 5:50 AMHi,
I'm currently trying to set up a PostgreSQL data source. I've read the documentation and various How-Tos but for some reason I can't get it to work.
First I've installed the driver as a module in org/postgresql/main. The module.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="org.postgresql">
<!-- Install with jboss-cli command
jboss-cli.sh --connect command="/subsystem=datasources/jdbc-driver=postgresql-driver:add(driver-name=postgresql-driver, driver-class-name=org.postgresql.Driver, driver-module-name=org.postgresql"
-->
<resources>
<resource-root path="postgresql-9.1-902.jdbc4.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
I installed the module using the JBoss CLI: jboss-cli.bat --connect command="/subsystem=datasources/jdbc-driver=postgresql-driver:add(driver-name=postgresql-driver, driver-class-name=org.postgresql.Driver, driver-module-name=org.postgresql"
It automatically added a driver definition to my standalone.xml:
<driver name="postgresql-driver" module="org.postgresql">
<driver-class>org.postgresql.Driver</driver-class>
</driver>
But when starting JBoss the log never mentions deploying the driver. It does however deploy the H2 driver wich was already declared in the standalone.xml file.
I tried adding a datasource defintion to standalone.xml using the postgres driver, but this only causes JBoss to log an error:
JBAS014775: New missing/unsatisfied dependencies: service jboss.jdbc-driver.postgresql (missing) dependents: [service jboss.data-source.java:jboss/datasources/PrototypeDS]
My datasource looks like this:
<datasource jndi-name="java:jboss/datasources/PrototypeDS" pool-name="PrototypeDS" enabled="true" use-java-context="true">
<connection-url>jdbc:postgresql:mdsdprototype</connection-url>
<driver>postgresql-driver</driver>
<security>
<user-name>mdsd</user-name>
<password>mdsd</password>
</security>
</datasource>
Any idea what I'm doing wrong?