I'm using wildfly and maven and I'm trying to deploy a java ee application to wildfly as well as add a mysql database as a datasource.
I've added the mysql-connector-java-5.1.6.jar driver in the \.wildfly\modules\system\layers\base\com\mysql\main folder aswell as a module.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.6.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
I've also edited the \.wildfly\standalone\configuration\module.standalone.xml file and added the datasource:
<datasource jndi-name="java:/mySQLDS" pool-name="quizzer" enabled="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/quizzer</connection-url>
<driver>mysqlDriver</driver>
<security>
<user-name>****</user-name>
<password>****</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<background-validation>true</background-validation>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</datasource>
As well as the driver:
<driver name="mysqlDriver" module="com.mysql">
<datasource-class>com.mysql.Driver</datasource-class>
</driver>
I'm using jboss forge and maven to build the project. When I try to deploy the application the generated warfile from the project I get the following error:
Cannot upload deployment: {"WFLYCTL0288: One or more services were unable to start due to one or more indirect dependencies not being available." => {"Services that were unable to start:" => ["jboss.deployment.unit.\"quickdemo.war\".POST_MODULE","jboss.persistenceunit.\"quickdemo.war#mySQLPersistence\".__FIRST_PHASE__"],"Services that may be the cause:" => ["jboss.jdbc-driver.mysqlDriver"]}}
Finally, this is my pom.xml file and this is the full stack from .forge\log\forge.log.
One more strange thing: The wildfly welcome screen on localhost:8080/ says WildFly 9 is running however console at localhost:9990/console/App.html#standalone-deployments (which is where one of the welcome screen links points to) says 10.0.0.Final and that makes more sense because it's the one I downloaded and installed. I think the other version may be due to the Wildfly As plugin I installed on forge or perhaps they simply forgot to update the welcome screen.
I think the problem with the driver class.
Use
<driver-class>com.mysql.jdbc.Driver</driver-class>instead<datasource-class>com.mysql.Driver</datasource-class>And its always recommended to have custom modules outside
systemdirectoryExact stack trace will be more helpful if you can provide,