1 Reply Latest reply on Sep 30, 2013 9:30 AM by gjerich

    jboss 7 mysql subsystem connecton problem

    gjerich Newbie

      hi,

      1. i would like to create mysql base as default for jboss 6.1. i assume i should put mysql connector jar (5.1.15) in  jboss/modules/system/layers/base/com/mysql/main directory(?)

      2. i create in same directory  module.xml with this code:

      <?xml version="1.0" encoding="UTF-8"?>
          <module xmlns="urn:jboss:module:1.0" name="com.mysql"> 
            <resources> 
              <resource-root path="mysql-connector-java-5.1.15.jar"/> 
            </resources> 
            <dependencies> 
              <module name="javax.api"/>

              <module name="javax.transaction.api"/>

              <module name="javax.servlet.api" optional="true"/>
            </dependencies> 
          </module>

      3. and finally  i include module in standalone.xml like this:

      <datasources>

         <datasource jndi-name="java:jboss/datasources/MySqlDS" pool-name="MySqlDS" enabled="true" use-java-context="true">

            <connection-url>jdbc:mysql://localhost:3306/EJB3</connection-url>

               <driver>com.mysql</driver>

            <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>

            <pool>

              <min-pool-size>10</min-pool-size>

              <max-pool-size>100</max-pool-size>

              <prefill>true</prefill>

            </pool>

            <security>

              <user-name>username</user-name>

              <password>password</password>

            </security>

            <statement>

              <prepared-statement-cache-size>32</prepared-statement-cache-size>

              <share-prepared-statements/>

            </statement>

          </datasource>

          <drivers>

            <driver name="com.mysql" module="com.mysql">

              <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>

            </driver>

          </drivers>

      </datasources>

       

      so in admin console i see MySqlDS (java:jboss/datasources/MySqlDS), but it is not connected correctly. Pool Usage is empty, so there is any pool size.. console return an error:

      Unknown error

      Unexpected HTTP response: 500
      
      Request
      {
          "address" => [
              ("subsystem" => "datasources"),
              ("data-source" => "MySqlDS"),
              ("statistics" => "jdbc")
          ],
          "operation" => "read-resource",
          "include-runtime" => true
      }
      
      Response
      
      Internal Server Error
      {
          "outcome" => "failed",
          "failure-description" => "JBAS014883: No resource definition is registered for address [
          (\"subsystem\" => \"datasources\"),
          (\"data-source\" => \"MySqlDS\"),
          (\"statistics\" => \"jdbc\")
      ]",
          "rolled-back" => true
      }

      log error:

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

          ("subsystem" => "datasources"),

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

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

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

       

      path definition problem(?)

       

      thanks in advanced.

       

       

      gasper

       

      Message was edited by: gasper jeric

        • 1. Re: jboss 7 mysql subsystem connecton problem
          gjerich Newbie

          i forget to create an mysql connector jar index file in boss/modules/system/layers/base/com/mysql/main directory.

          so mysql-connector-java-5.1.15.jar.index with content:

          META-INF
          META-INF/services
          com
          com/mysql
          com/mysql/jdbc
          com/mysql/jdbc/configs
          com/mysql/jdbc/exceptions
          com/mysql/jdbc/integration
          com/mysql/jdbc/integration/c3p0
          com/mysql/jdbc/integration/jboss
          com/mysql/jdbc/jdbc2
          com/mysql/jdbc/jdbc2/optional
          com/mysql/jdbc/log
          com/mysql/jdbc/profiler
          com/mysql/jdbc/util
          org
          org/gjt
          org/gjt/mm
          org/gjt/mm/mysql

           

          gasper