Mistakes in previous article about installing PostgreSQL JDBC-driver in jBoss

I apologize for mistake in my previous article. I have forgotten to remove PostgreSQL JDBC-driver from dependencies list, so it has covered a mistake of defining of JDBC-driver as jBoss module.

Here are amendments to the previous article:

  1. Be sure that dependency
    <dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>9.4-1200-jdbc41</version>
    <scope>all</scope>
    </dependency>
    

    is removed from pom.xml file of your simplecrud-service-spring project

  2. Place module.xml and JAR-files into $JBOSS_HOME/modules/org/postgresql/main directory instead of
    $JBOSS_HOME/modules/system/layers/base/org/postgresql/main.
  3. If you run jBoss in standalone mode, open $JBOSS_HOME/standalone/configuration/standalone.xml file and append manually new JDBC-driver reference in section “subsystem/datasources/drivers”:
    <driver name="PostgreSQL" module="org.postgresql">
    <xa-datasource-class>org.postgresql.Driver</xa-datasource-class>
    </driver>
    

    After jBoss restart it will appear in list of available JDBC-drivers. jBoss can’t detect some JDBC-drivers in it’s modules authomatically because of some supposed bug, which can’t recognizes JDBC-driver, if module contains more than one it’s implementation.

  4. Restart jBoss, open a console, and create new data source using “PostgreSQL” JDBC-driver, which appears in list of available drivers.

UPDATE. Related article:
http://kousikraj.me/2011/11/25/datasource-configuration-setup-for-jboss-as-7-with-example-of-postgresql

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s