Search code examples
jdbcwildflywildfly-10

wildfly - installing postgres driver jar


I am having difficulty installing the postgres driver. I've tried a bunch of things:

  1. https://docs.jboss.org/author/display/WFLY10/Application+deployment

    a. tried "deploying" the JAR (both from CLI and admin console UI)

  2. https://sites.google.com/site/jmdstips/jboss-wildfly/postgresql-on-wildfly---xa-datasource

    a. tried putting module definition in modules/org/postgresql ...

    b. tried putting module definition in modules/system/layers/base/org/postgresql

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="org.postgres">
    <resources>
        <resource-root path="postgresql-9.4.1212.jre7.jar" />
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
        <module name="javax.servlet.api" optional="true"/>
    </dependencies>
</module>

And:

<drivers>
    <driver name="h2" module="com.h2database.h2">
        <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
    </driver>
        <driver name="postgresql" module="org.postgresql">
                <datasource-class>org.postgresql.Driver</datasource-class>
                <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
        </driver>
</drivers>

After all of that, I get this error. So, I think wildfly can "see" the module, but something is awry.

23:24:15,889 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 33) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("jdbc-driver" => "postgresql")
]) - failure description: "WFLYJCA0041: Failed to load module for driver [org.postgresql]"

Solution

  • It turns out I used "org.postgres" for the module name in standalone.xml instead of "org.postgresql" which is what I declared it as inside the module.xml