title: "WFLYJCA0041: Failed to load module for driver [com.mysql]" on Jboss 7 with MySQL database
body: <p>I am creating a web application for JBoss EAP 7 and trying to connect to <code>MySQL 8.0</code> database.</p>
  
  <p>Am getting the error as </p>
  
  <blockquote>
    <p>[org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 39) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "datasources"),
            ("jdbc-driver" => "mysql")]) - failure description: "WFLYJCA0041: Failed to load module for driver [com.mysql]"</p>
  </blockquote>
  
  <pre><code>My module.xml file in \jboss-eap-7.1.0\modules\system\layers\base\com\mysql\main is as follows:
  
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;module xmlns="urn:jboss:module:1.3" name="com.mysql"&gt;
      &lt;resources&gt;
          &lt;resource-root path="mysql-connector-java-8.0.12" /&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;
  
  And placed "mysql-connector-java-8.0.12.jar" in \jboss-eap-7.1.0\modules\system\layers\base\com\mysql\main path where module.xml exist.
  </code></pre>
  
  <p>Datasource configuraion is:</p>
  
  <pre><code>&lt;datasources&gt;
                  &lt;datasource jta="true" jndi-name="java:jboss/datasources/jdbc/sdmspool" pool-name="sdmspool" enabled="true" use-java-context="true"&gt;
                      &lt;connection-url&gt;jdbc:sqlserver://database;databaseName = sdms&lt;/connection-url&gt;
                      &lt;driver&gt;mysql-connector-java-8.0.12&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;/datasource&gt;
                  &lt;drivers&gt;
                      &lt;driver name="mysql-connector-java-8.0.12" 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;
              &lt;/datasources&gt;
  </code></pre>
  
  <p>Can anyone help me in solving this?</p>