5 Replies Latest reply on Jun 6, 2014 3:09 AM by jaikiran pai

    MySQL Datasource won't load (jdbc driver)?

    David Eaton Newbie

      I'm pretty new to not only JBoss, but Java in general, so this is likely some sort of newbie mistake, but I'm not sure what's going on.

       

      I'm attempting to follow a tutorial here:

      http://www.mastertheboss.com/resteasy/restful-web-services-on-jboss-as-7

       

      Which requires me to set up a datasource, which I'm doing as seen here:

      http://www.mastertheboss.com/jboss-datasource/how-to-configure-a-datasource-with-jboss-7

       

      Presently, when I start up the JBoss-eap, I get this:

       

      23:06:08,676 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final-redhat-2

      23:06:08,880 INFO  [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA-redhat-1

      23:06:08,958 INFO  [org.jboss.as] (MSC service thread 1-6) JBAS015899: JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14) starting

      23:06:09,956 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found RestTest1.war in deployment directory. To trigger deployment create a file called RestTest1.war.dodeploy

      23:06:09,989 INFO  [org.xnio] (MSC service thread 1-10) XNIO Version 3.0.7.GA-redhat-1

      23:06:09,989 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)

      23:06:09,989 INFO  [org.xnio.nio] (MSC service thread 1-10) XNIO NIO Implementation Version 3.0.7.GA-redhat-1

      23:06:09,989 INFO  [org.jboss.remoting] (MSC service thread 1-10) JBoss Remoting version 3.2.18.GA-redhat-1

      23:06:10,020 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 29) JBAS010280: Activating Infinispan subsystem.

      23:06:10,035 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 37) JBAS011800: Activating Naming Subsystem

      23:06:10,035 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 42) JBAS013171: Activating Security Subsystem

      23:06:10,051 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 46) JBAS015537: Activating WebServices Extension

      23:06:10,051 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 35) JBAS012605: Activated the following JSF Implementations: [main, 1.2]

      23:06:10,051 INFO  [org.jboss.as.security] (MSC service thread 1-11) JBAS013170: Current PicketBox version=4.0.19.SP2-redhat-1

      23:06:10,067 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-13) JBAS010408: Starting JCA Subsystem (IronJacamar 1.0.23.Final-redhat-1)

      23:06:10,098 INFO  [org.jboss.as.naming] (MSC service thread 1-15) JBAS011802: Starting Naming Service

      23:06:10,098 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-13) JBAS015400: Bound mail session [java:jboss/mail/Default]

      23:06:10,145 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

      23:06:10,160 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 25) JBAS014613: Operation ("add") failed - address: ([

          ("subsystem" => "datasources"),

          ("jdbc-driver" => "mysql")

      ]) - failure description: "JBAS010441: Failed to load module for driver [com.mysql]"

       

      Here's a snippit from standalone.xml (I've actually got this in both standalone.xml and domain.xml presently):

       

      <subsystem xmlns="urn:jboss:domain:datasources:1.1">
        <datasources>
          <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
            <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
            <driver>h2</driver>
            <security>
              <user-name>sa</user-name>
              <password>sa</password>
            </security>
          </datasource>
          <datasource jndi-name="java:/MySqlDS" pool-name="MySQLPool">
            <connection-url>
              jdbc:mysql://myserver:3306/mydb
            </connection-url>
            <driver>mysql</driver>
            <pool><max-pool-size>30</max-pool-size></pool>
            <security><user-name>user1</user-name><password>pass1</password></security>
          </datasource>
          <drivers>
            <driver name="h2" module="com.h2database.h2">
              <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
            </driver>
            <driver name="mysql" module="com.mysql"></driver>
          </drivers>
        </datasources>
      </subsystem>
      
      

      My module.xml file (in modules/com/mysql/main) looks like this:

       

      <module xmlns="urn:jboss:module:1.0" name="com.mysql">
          <resources>
              <resource-root path="mysql-connector-java-5.1.17-bin.jar"/>
           </resources>
           <dependencies>
              <module name="javax.api"/>
              <module name="javax.transaction.api"/>
          </dependencies>
      </module>
      

       

      The above error seems to be causing the rest of my sample to fail with this:

       

      JBAS014775:New missing/unsatisfied dependencies:
        service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.driver-demander.java:/MySqlDS, service jboss.data-source.java:/MySqlDS]

       

      Any ideas what I'm doing wrong?