4 Replies Latest reply: Jun 29, 2011 11:15 AM by Oved Ourfali RSS

using postgresql driver in as7

Oved Ourfali Newbie



I want to deploy the postgresql jdbc driver, so I downloaded a driver that supports jdbc4 from http://jdbc.postgresql.org/download.html

(the version I used is 9.0-801 JDBC 4 )


I added a datasource entry in standalone.xml, and also a driver entry there.


On startup, I get the following errors:


16:27:54,850 ERROR [org.jboss.as.server] Boot update failed: "Failed to load module for driver [org.postgresql.Driver]"


and afterwards:


16:27:58,353 INFO  [org.jboss.as.server] (MSC service thread 1-1) Service status report

   New missing/unsatisfied dependencies:

      service jboss.jdbc-driver.____________________________ (missing) required by [service jboss.data-source.java:/DataSource]


I followed the manual in https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7

and http://community.jboss.org/wiki/DataSourceConfigurationinAS7

in order to add that jdbc driver.


I made sure I have the META-INF/services/java.sql.Driver in the jar, and I put the jar in the deployments directory.

(Before trying version 9.0-801 I tried an older version that didn't contain the file above, so I used the manual to add the file, but it didn't help).


Are you familiar with some kind of problem with the postgresql driver with AS7?


A working postgresql-as7 configuration sample will be helpful.


Thank you,


  • 1. Re: using postgresql driver in as7
    Juergen Zimmermann Master

    I'm using PG 9.1beta2, and the driver 9.1 since 2 or 3 weeks. There are no problems. What did you exactly do:

    a) Deployment of the driver or provisioning as a module?

    b) What exactly are your modifications in standalone.xml?

  • 2. Re: using postgresql driver in as7
    Oved Ourfali Newbie

    I used provisioning.


    I made the following modifications to standalone.xml:


    under datasources:


               <datasource jndi-name="java:/DataSource" pool-name="DataSource" enabled="true" use-java-context="true">




    and under drivers:


    <driver name="postgresql-9.0-801.jdbc4.jar" module="org.postgresql.Driver"/>

  • 3. Re: using postgresql driver in as7
    Juergen Zimmermann Master

    This is my module.xml:

          <?xml version="1.0" encoding="UTF-8"?>

          <module xmlns="urn:jboss:module:1.0" name="org.postgresql">
                <resource-root path="postgresql.jar"/>

                <module name="javax.api"/>
                <module name="javax.transaction.api"/>

    This is my datasource section

          <datasource jndi-name="java:/swe1DS" pool-name="swe1DS">
               <check-valid-connection-sql>SELECT 1</check-valid-connection-sql>




          <driver name="postgresql" module="org.postgresql">

    I defined the XA datasource class because I also had problems before. I don't have the driver class declaration inside the datasource section.

  • 4. Re: using postgresql driver in as7
    Oved Ourfali Newbie

    As a module it indeed worked.


    Thank you,