4 Replies Latest reply on Sep 25, 2017 11:13 AM by David Wennemaring

    Add driver in domain mode

    David Wennemaring Newbie

      Hello everyone,

       

      I'm running my wildfly 10.0.0.Final in domain mode and want to add a datasource to a Mysql-Server.

       

      I tried to deploy the jdbc.jar to the server with this command:

      deploy <path-to-file>/mysql-connector-java-5.1.44-bin.jar --all-server-groups
      

       

      Then I tried to run this script to add the datasource:

      /profile=ha/subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql,driver-class-name="${db.driver}")
      /profile=ha/subsystem=datasources/data-source=mysqlDS:add(jndi-name="${db.jndi_name}",  driver-name=mysql,  connection-url="${db.url}", user-name="${db.user}", password="${db.password}", enabled=true, use-java-context=true )
      

       

      This is my properties file:

      db.driver=com.mysql.jdbc.Driver
      db.jndi_name=java:/Sample_MySQL
      db.url=jdbc:mysql://192.168.56.1:3306/employees
      db.user=admin
      db.password=admin
      

       

      The result is the following error:

      Failed to load module for driver [com.mysql]

       

      What do I have to do to use the driver?

      Kinde regards,

      David