title: Datasource configuration in wildfly 10
body: <p>I am trying to configure a PostgreSQL datasource in Wildfly 10 Application Server on Mac OS. I am doing what the instructions prescribe. I have created an order: </p>
  
  <pre><code>/wildfly-10.1.0.Final/modules/system/layers/base/org/postgresql/main. 
  </code></pre>
  
  <p>In this order I have put the JDBC driver:</p>
  
  <pre><code>postgresql-9.3-1104.jdbc4.jar
  </code></pre>
  
  <p>and I have created a <code>module.xml</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;module xmlns="urn:jboss:module:1.3" name="org.postgresql“&gt;
    &lt;resources&gt;
      &lt;resource-root path="postgresql-9.3-1104.jdbc4.jar"/&gt;
    &lt;/resources&gt;
    &lt;dependencies&gt;
      &lt;module name="javax.api"/&gt;
      &lt;module name="javax.transaction.api"/&gt;
    &lt;/dependencies&gt;
  &lt;/module&gt;
  </code></pre>
  
  <p>In the standalone.xml file I have created the datasource under datasources:</p>
  
  <pre><code>     &lt;datasource jndi-name="java:jboss/datasources/PostgresDS" pool-name="PostgresDS" enabled="true"
                          use-java-context="true"&gt;
     &lt;connection-url&gt;jdbc:postgresql://localhost:5432/testdb&lt;/connection-url&gt;
           &lt;driver&gt;postgresql&lt;/driver&gt;
              &lt;security&gt;
               &lt;user-name&gt;user&lt;/user-name&gt;
               &lt;password&gt;password&lt;/password&gt;
              &lt;/security&gt;
              &lt;validation&gt;
                &lt;valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"&gt;&lt;/valid-connection-checker&gt;
                &lt;exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"&gt;&lt;/exception-sorter&gt;
       &lt;/validation&gt;
     &lt;/datasource&gt;
  </code></pre>
  
  <p>and drivers as:</p>
  
  <pre><code>&lt;drivers&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>However it is impossible the datasource is not installed and when I start the server I get the message (error):</p>
  
  <pre><code>ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
              ("subsystem" =&gt; "datasources"),
              ("data-source" =&gt; "PostgresDS")
          ]) - failure description: {
              "WFLYCTL0412: Required services that are not installed:" =&gt; ["jboss.jdbc-driver.postgresql"],
              "WFLYCTL0180: Services with missing/unavailable dependencies" =&gt; [
                  "org.wildfly.data-source.PostgresDS is missing [jboss.jdbc-driver.postgresql]",
                  "jboss.driver-demander.java:jboss/datasources/PostgresDS is missing [jboss.jdbc-driver.postgresql]"
              ]
          }
      [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
          ("subsystem" =&gt; "datasources"),
          ("data-source" =&gt; "PostgresDS")
      ]) - failure description: {
          "WFLYCTL0412: Required services that are not installed:" =&gt; [
              "jboss.jdbc-driver.postgresql",
              "jboss.jdbc-driver.postgresql"
          ],
          "WFLYCTL0180: Services with missing/unavailable dependencies" =&gt; [
              "org.wildfly.data-source.PostgresDS is missing [jboss.jdbc-driver.postgresql]",
              "jboss.driver-demander.java:jboss/datasources/PostgresDS is missing [jboss.jdbc-driver.postgresql]",
              "org.wildfly.data-source.PostgresDS is missing [jboss.jdbc-driver.postgresql]"
          ]
      }
  </code></pre>
  
  <p>It seems, that <code>wildfly</code> maybe does not find the module. Any ideas what causes this problem? Is anything wrong in my configuration?  </p>