Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1107120 - Failures when deploying MySQL JDBC driver to EAP 6.x
Failures when deploying MySQL JDBC driver to EAP 6.x
Status: VERIFIED
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JCA (Show other bugs)
6.3.0
Unspecified Unspecified
unspecified Severity medium
: DR1
: EAP 6.4.0
Assigned To: tom.jenkinson
Martin Simka
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-09 15:41 EDT by Josef Cacek
Modified: 2018-03-06 15:37 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A previous release of JBoss EAP 6 carried a bug that prevented the MySQL JDBC driver being depoyed under certain circumstances. The deployment would fail, informing the user that the deployment already existed. Any attempt to remove an existing deployment also failed. This issue has been resolved and the driver deploys as expected.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-3218 Major Closed Module for MySQL JDBC driver with version 5.1.30+ needs <driver-class> in standalone.xml 2018-05-03 09:20 EDT

  None (edit)
Description Josef Cacek 2014-06-09 15:41:39 EDT
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)
...
Comment 1 Josef Cacek 2014-06-10 05:53:22 EDT
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.
Comment 2 Stefano Maestri 2014-09-10 10:42:11 EDT
Need a backport of jira issue
Comment 3 Kabir Khan 2014-09-15 07:20:58 EDT
https://github.com/jbossas/jboss-eap/pull/1674
Comment 4 Jeff Zhang 2014-09-16 06:18:42 EDT
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
Comment 5 Martin Simka 2014-09-18 08:06:04 EDT
verified on EAP 6.4.0.DR1.1

Note You need to log in before you can comment on or make changes to this bug.