title: Wildfly 10 failing to load MySQL XA driver on startup
body: <p>I have a web application I am deploying in wildfly-10.0.0. It requires a mysql xa driver. I have the following error:</p>
  
  <blockquote>
    <p>2015-10-13 12:25:37,979 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 33) WFLYCTL0013: Operation ("add") failed - address: ([
        ("subsystem" => "datasources"),
        ("jdbc-driver" => "com.mysql")
    ]) - failure description: "WFLYJCA0041: Failed to load module for driver [com.mysql]"</p>
  </blockquote>
  
  <p>The modules directory is as follows:</p>
  
  <pre><code> Directory of C:\Users\rball\Documents\Dev\WildFly\wildfly-10.0.0.CR1\modules\sy
  stem\layers\base\com\mysql\main
  
  10/13/2015  11:32 AM    &lt;DIR&gt;          .
  10/13/2015  11:32 AM    &lt;DIR&gt;          ..
  10/13/2015  12:25 PM             1,575 module.xml
  03/17/2015  05:21 AM           968,670 mysql-connector-java-5.1.35-bin.jar
  </code></pre>
  
  <p>The module.xml file is:</p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="UTF-8"?&gt;    
  
  &lt;module xmlns="urn:jboss:module:1.1" name="com.mysql"&gt;  
    &lt;resources&gt;  
      &lt;resource-root path="mysql-connector-java-5.1.35-bin.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>I added the driver and datasource to the datasources section of standalone.xml:</p>
  
  <pre><code>&lt;xa-datasource jndi-name="java:/jdbc/MyXaDS" pool-name="MyXaDSPool" enabled="true" use-ccm="false"&gt;
                  &lt;xa-datasource-property name="URL"&gt;
                      jdbc:mysql://localhost:3306/temp?autoReconnect=true&amp;amp;useUnicode=true&amp;amp;characterEncoding=UTF-8
                  &lt;/xa-datasource-property&gt;
                  &lt;xa-datasource-class&gt;com.mysql.jdbc.jdbc2.optional.MysqlXADataSource&lt;/xa-datasource-class&gt;
                  &lt;driver&gt;com.mysql&lt;/driver&gt;
                  &lt;xa-pool&gt;
                      &lt;min-pool-size&gt;10&lt;/min-pool-size&gt;
                      &lt;max-pool-size&gt;20&lt;/max-pool-size&gt;
                      &lt;is-same-rm-override&gt;false&lt;/is-same-rm-override&gt;
                      &lt;interleaving&gt;false&lt;/interleaving&gt;
                      &lt;pad-xid&gt;false&lt;/pad-xid&gt;
                      &lt;wrap-xa-resource&gt;false&lt;/wrap-xa-resource&gt;
                  &lt;/xa-pool&gt;
                  &lt;security&gt;
                      &lt;user-name&gt;root&lt;/user-name&gt;
                      &lt;password&gt;password&lt;/password&gt;
                  &lt;/security&gt;
                  &lt;validation&gt;
                      &lt;validate-on-match&gt;false&lt;/validate-on-match&gt;
                      &lt;background-validation&gt;false&lt;/background-validation&gt;
                      &lt;background-validation-millis&gt;1000&lt;/background-validation-millis&gt;
                  &lt;/validation&gt;
                  &lt;statement&gt;
                      &lt;prepared-statement-cache-size&gt;0&lt;/prepared-statement-cache-size&gt;
                      &lt;share-prepared-statements&gt;false&lt;/share-prepared-statements&gt;
                  &lt;/statement&gt;
              &lt;/xa-datasource&gt;
              &lt;drivers&gt;
                  &lt;driver name="com.mysql" module="com.mysql"&gt;
                      &lt;driver-class&gt;com.mysql.jdbc.Driver&lt;/driver-class&gt;
                      &lt;xa-datasource-class&gt;com.mysql.jdbc.jdbc2.optional.MysqlXADataSource&lt;/xa-datasource-class&gt;
                  &lt;/driver&gt;
              &lt;/drivers&gt;
  </code></pre>