2 Replies Latest reply on Mar 16, 2015 7:29 AM by takis

    Intermittent fail of some datasource tests on IBM JDK after attempt to load mysql driver for h2 datasource

    takis

      Hello,

       

      There are some intermittent fails of some datasource tests on IBM JDK after attempt to load mysql driver for h2 datasource (Bug 1100839 – (6.4.0) Intermittent fail of some datasource tests on IBM JDK after attempt to load mysql driver for h2 da…).

       

      This is an issue similar to :

      https://issues.jboss.org/browse/JBPAPP6-1270

       

      Here is exactly what happens :

      1. If the testCase AddMySqlDataSourceOperationsUnitTestCase is run first then mysql-connector-java-5.1.15.jar is loaded as a deployment.

      2 .In the class java.sql.DriverManager there is --private static final List<Driver> theDrivers-- where the the drivers are stored.

      3. When the testCase AddMySqlDataSourceOperationsUnitTestCase is finished the deployment mysql-connector-java-5.1.15.jar is undeployed (as expected).

      4. But the driver still exists in static final List<Driver> theDrivers.

      5. When the next testCase (DsTestCase) is executed and the method java.sql.DriverManager.getDriver is called then it checks all the drivers that are stored in --static final List<Driver> theDrivers--. So when the command Driver.acceptsURL is executed for the mysql driver the server tries to load the class com.mysql.jdbc.StringUtils, but as the deployment was naturally undeployed with the end of the previous test, it throws a ClassNotFoundException.

      6. This exception is handled when using the jdk 1.7 :

      http://pastebin.test.redhat.com/254340

      but is not handled when using jdk 1.6:

      http://pastebin.test.redhat.com/254339

       

      We think we could add some code here : ironjacamar/LocalManagedConnectionFactory.java at 7ea102d79dbeac9f0cbfcacfbe86f9c8f34817de · ironjacamar/ironjacamar · G… that will return the false value in case the IBM JDK 1.6 is used.

       

      What is your opinion?

       

      Thank you in advance,

      Panagiotis Sotiropoulos