title: wildfly - installing postgres driver jar
body: <p>I am having difficulty installing the postgres driver.  I've tried a bunch of things:</p>
  
  <ol>
  <li><p><a href="https://docs.jboss.org/author/display/WFLY10/Application+deployment" rel="nofollow noreferrer">https://docs.jboss.org/author/display/WFLY10/Application+deployment</a></p>
  
  <p>a. tried "deploying" the JAR (both from CLI and admin console UI)</p></li>
  <li><p><a href="https://sites.google.com/site/jmdstips/jboss-wildfly/postgresql-on-wildfly---xa-datasource" rel="nofollow noreferrer">https://sites.google.com/site/jmdstips/jboss-wildfly/postgresql-on-wildfly---xa-datasource</a></p>
  
  <p>a. tried putting module definition in modules/org/postgresql ...</p>
  
  <p>b. tried putting module definition in modules/system/layers/base/org/postgresql</p></li>
  </ol>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;module xmlns="urn:jboss:module:1.3" name="org.postgres"&gt;
      &lt;resources&gt;
          &lt;resource-root path="postgresql-9.4.1212.jre7.jar" /&gt;
      &lt;/resources&gt;
      &lt;dependencies&gt;
          &lt;module name="javax.api"/&gt;
          &lt;module name="javax.transaction.api"/&gt;
          &lt;module name="javax.servlet.api" optional="true"/&gt;
      &lt;/dependencies&gt;
  &lt;/module&gt;
  </code></pre>
  
  <p>And:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;drivers&gt;
      &lt;driver name="h2" module="com.h2database.h2"&gt;
          &lt;xa-datasource-class&gt;org.h2.jdbcx.JdbcDataSource&lt;/xa-datasource-class&gt;
      &lt;/driver&gt;
          &lt;driver name="postgresql" module="org.postgresql"&gt;
                  &lt;datasource-class&gt;org.postgresql.Driver&lt;/datasource-class&gt;
                  &lt;xa-datasource-class&gt;org.postgresql.xa.PGXADataSource&lt;/xa-datasource-class&gt;
          &lt;/driver&gt;
  &lt;/drivers&gt;
  </code></pre>
  
  <p>After all of that, I get this error.  So, I think wildfly can "see" the module, but something is awry.</p>
  
  <pre class="lang-none prettyprint-override"><code>23:24:15,889 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 33) WFLYCTL0013: Operation ("add") failed - address: ([
      ("subsystem" =&gt; "datasources"),
      ("jdbc-driver" =&gt; "postgresql")
  ]) - failure description: "WFLYJCA0041: Failed to load module for driver [org.postgresql]"
  </code></pre>