When 2 or more classes are used in META-INF/services/java.sql.Driver, then adding the JDBC driver fails with message: JBAS014749: Operation handler failed: Service jboss.jdbc-driver.mysql is already registered Steps to reproduce - Follow instructions "6.2.2. Install a JDBC Driver as a Core Module" in Admin guide [1]: 1) download MySQL JDBC driver from [2], put it under [EAP_INST]/modules/com/mysql/main/ and create also module.xml 2) run ./standalone.sh 3) run CLI command: /subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql,driver-xa-datasource-class-name=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource) It results in response: { "outcome" => "failed", "failure-description" => "JBAS014749: Operation handler failed: Service jboss.jdbc-driver.mysql is already registered", "rolled-back" => true } And server-log contains exception [3]. 4.a) when the user realizes there are 2 driver classes, he can try to fix the problem with specifying the driver class: /subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql,driver-xa-datasource-class-name=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource, driver-class-name=com.mysql.jdbc.Driver) but: { "outcome" => "failed", "failure-description" => "JBAS010434: Unable to instantiate driver class \"com.mysql.jdbc.Driver\". See log (WARN) for more details", "rolled-back" => true } 4.b) so the user tries to delete existing instance: /subsystem=datasources/jdbc-driver=mysql:remove but: { "outcome" => "failed", "failure-description" => "JBAS014807: Management resource '[ (\"subsystem\" => \"datasources\"), (\"jdbc-driver\" => \"mysql\") ]' not found", "rolled-back" => true } 5) when user reload (or restart) server, he's able to add the driver: [standalone@localhost:9999 /] reload [standalone@localhost:9999 /] /subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql,driver-xa-datasource-class-name=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource, driver-class-name=com.mysql.jdbc.Driver) {"outcome" => "success"} Points 3, 4.a and 4.b shows issues when adding the JDBC driver. [1] https://access.redhat.com/site/documentation/en-US/JBoss_Enterprise_Application_Platform/6.2/html/Administration_and_Configuration_Guide/Install_a_JDBC_Driver_as_a_Core_Module1.html [2] http://dev.mysql.com/downloads/connector/j/ [3] 21:24:20,463 INFO [org.jboss.as.connector.subsystems.datasources] (management-handler-thread - 3) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1) 21:24:20,475 INFO [org.jboss.as.connector.subsystems.datasources] (management-handler-thread - 3) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.fabric.jdbc.FabricMySQLDriver (version 5.1) 21:24:20,486 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 3) JBAS014612: Operation ("add") failed - address: ([ ("subsystem" => "datasources"), ("jdbc-driver" => "mysql") ]): org.jboss.msc.service.DuplicateServiceException: Service jboss.jdbc-driver.mysql is already registered at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:158) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1] at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:236) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1] at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:742) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1] at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:243) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1] at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2433) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1] at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:345) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1] at org.jboss.as.controller.OperationContextImpl$ContextServiceBuilder.install(OperationContextImpl.java:1672) [jboss-as-controller-7.4.0.Final-redhat-15.jar:7.4.0.Final-redhat-15] at org.jboss.as.connector.subsystems.datasources.JdbcDriverAdd.startDriverServices(JdbcDriverAdd.java:160) at org.jboss.as.connector.subsystems.datasources.JdbcDriverAdd.performRuntime(JdbcDriverAdd.java:118) ...
The problem can be reproduced with MySQL driver version 5.1.30 and newer. Older versions have only 1 entry in the META-INF/services/java.sql.Driver file.
Need a backport of jira issue
https://github.com/jbossas/jboss-eap/pull/1674
PR https://github.com/jbossas/jboss-eap/pull/1674 for 6.X had been merged. PR for 6.3.X is https://github.com/jbossas/jboss-eap/pull/1688
verified on EAP 6.4.0.DR1.1