Postgres Datasource
jensmander Jul 5, 2011 5:17 AMHi,
I am trying to get my datasource running for a postgreSQL backend. Although it seems to be well documented I can't get it running. These are the messages at startup:
11:08:48,267 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) Bound data source [java:jboss/datasources/ExampleDS] 11:08:48,638 INFO [org.jboss.as.deployment] (MSC service thread 1-3) Started FileSystemDeploymentService for directory /opt/jboss7/standalone/deployments 11:08:48,840 INFO [org.jboss.as.controller] (Controller Boot Thread) Service status report New missing/unsatisfied dependencies: service jboss.jdbc-driver.postgresql (missing)
I set up the driver by creating the directory $JBOSS_HOME/modules/org/postgresql/main and put in the postgresql-9.0-801.jdbc4.jar. Additionally I created the module.xml as followed
<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.0" name="org.postgresql"> <resources> <resource-root path="postgresql-9.0-801.jdbc4.jar"/> </resources> <dependencies> <module name="javax.api"/> <module name="javax.transaction.api"/> </dependencies> </module>
Now I configured the datasource in $JBOSS_HOME/standalone/configuration/standalone.xml like this:
<datasource jndi-name="java:/CatDS" pool-name="CatDS" enabled="true" jta="true" use-java-context="true" use-ccm="true"> <connection-url>jdbc:postgresql://host/db</connection-url> <driver>org.postgresql</driver> <pool> <min-pool-size>1</min-pool-size> <max-pool-size>4</max-pool-size> <prefill>false</prefill> <use-strict-min>false</use-strict-min> <flush-strategy>FailingConnectionOnly</flush-strategy> </pool> <security> <user-name>...</user-name> <password>...</password> </security> <validation> <check-valid-connection-sql>SELECT 1</check-valid-connection-sql> <validate-on-match>false</validate-on-match> <background-validation>false</background-validation> <useFastFail>false</useFastFail> </validation> </datasource> <drivers> ... <driver name="org.postgresql" module="org.postgresql"> <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class> </driver> </drivers>
May anybody tell me what is wrong with my setup?
Best regards
Sascha