1

Am trying to run my JBOSS after Configuring mysql dependencies, but having this errors

09:49:00,138 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "TripTicketDS")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
    "jboss.data-source.java:jboss/datasources/TripTicketDS is missing [jboss.jdbc-driver.mysql]",
    "jboss.driver-demander.java:jboss/datasources/TripTicketDS is missing [jboss.jdbc-driver.mysql]"
]}
09:49:00,149 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("data-source" => "TripTicketDS")
]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => [
    "jboss.data-source.java:jboss/datasources/TripTicketDS is missing [jboss.jdbc-driver.mysql]",
    "jboss.driver-demander.java:jboss/datasources/TripTicketDS is missing [jboss.jdbc-driver.mysql]",
    "jboss.data-source.java:jboss/datasources/TripTicketDS is missing [jboss.jdbc-driver.mysql]"
]}

My standalone.xml configurations are as follows

<datasource jndi-name="java:jboss/datasources/TripTicketDS" pool-name="TripTicketDS" enabled="true" use-java-context="true">
    <connection-url>jdbc:mysql://localhost:3306/trip_ticket</connection-url>
    <driver>mysql</driver>
    <security>
        <user-name>root</user-name>
        <password></password>
    </security>
</datasource>

my SQL module.xml file looks like this

<?xml version="1.0" encoding="UTF-8"?> 
<module xmlns="urn:jboss:module:1.3" name="com.sql.mysql"> 
    <resources> 
        <resource-root path="mysql-connector-java-5.1.39-bin.jar"/> 
    </resources> 
    <dependencies> 
        <module name="javax.api"/> 
    </dependencies> 
</module> 
James R. Perkins
  • 16,800
  • 44
  • 60

2 Answers2

1

Try creating the Module itself using the jboss-cli.sh command rather than manually writing the module.xml file. This is because when we use some text editors, they might append some hidden chars to our files. (Specially when we do a copy & paste in such editors)

[standalone@localhost:9990 /]  module add --name=com.mysql.driver  --dependencies=javax.api,javax.transaction.api --resources=/PATH/TO/mysql-connector-java-5.1.35.jar  

[standalone@localhost:9990 /] :reload  
{  
    "outcome" => "success",  
    "result" => undefined  
}  

After running above command you should see the module.xml generated in the following location: "wildfly-version.Final/modules/com/mysql/driver/main/module.xml"

Now create DataSource:

[standalone@localhost:9990 /] /subsystem=datasources/jdbc-driver=mysql/:add(driver-module-name=com.mysql.driver,driver-name=mysql,jdbc-compliant=false,driver-class-name=com.mysql.jdbc.Driver)  
{"outcome" => "success"}  
Rishi Gautam
  • 1,948
  • 3
  • 21
  • 31
0

You're driver name is incorrect. It needs to be the same as your module name which is com.sql.mysql.

Instead of editing the XML however I'd suggest using CLI or the web console to add the data source. With CLI you can also add the module.

module add --name=com.mysql --resources=~/Downloads/mysql-connector-java-5.1.37/mysql-connector-java-5.1.37-bin.jar --dependencies=javax.api,javax.transaction.api

/subsystem=datasources/jdbc-driver=com.mysql:add(driver-name=com.mysql, driver-module-name=com.mysql, driver-xa-datasource-class-name=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource)
/subsystem=datasources/data-source=TripTicketDS:add(driver-name=com.mysql, jndi-name="java:jboss/datasources/TripTicketDS", enabled=true, connection-url="jdbc:mysql://localhost:3306/trip_ticket", user-name=root, password="mypassword")
James R. Perkins
  • 16,800
  • 44
  • 60