Bug 1100839

Summary: (6.4.0) Intermittent fail of some datasource tests on IBM JDK after attempt to load mysql driver for h2 datasource
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Pavel Jelinek <pjelinek>
Component: TestsuiteAssignee: Panagiotis Sotiropoulos <psotirop>
Status: CLOSED WONTFIX QA Contact: Petr Kremensky <pkremens>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbaranow, cdewolf, kkhan, pkremens, psotirop, thofman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1135963 (view as bug list) Environment:
IBMJDK
Last Closed: 2015-03-23 13:47:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 996500, 1135963    
Attachments:
Description Flags
stacktrace and output of DataSourceOperationsUnitTestCase.testXaDsWithSystemProperties none

Description Pavel Jelinek 2014-05-23 14:49:01 UTC
Created attachment 898708 [details]
stacktrace and output of DataSourceOperationsUnitTestCase.testXaDsWithSystemProperties

Affected testcases:
org.jboss.as.test.smoke.mgmt.datasource.DataSourceOperationsUnitTestCase ,
org.jboss.as.test.smoke.datasource.DsTestCase

See:
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/view/EAP6/view/EAP6-AS-Testsuite/job/eap-6x-as-testsuite-RHEL-matrix-IBMJDK6/87/jdk=ibm16,label_exp=EAP-RHEL7/testReport/

Comment 3 Panagiotis Sotiropoulos 2014-11-11 10:09:43 UTC
Tested with IBM JDK 1.6 and the tests pass. Could the QA rerun the tests and provide an updated status?

Comment 4 Petr Kremensky 2014-11-12 11:52:59 UTC
Hello,
yes, we can still see it, but it doesn't occurs every time and I was not able to find what's triggering it so far.

https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/eap-6x-as-testsuite-rhel/29/RELEASE=6.4.0,jdk=ibm1.6,label_exp=eap-sustaining&&RHEL5&&x86/testReport/junit/

Comment 6 Panagiotis Sotiropoulos 2014-11-12 13:49:59 UTC
I have run the testsuite for several times and all the tests pass.

Which build of the IBM JDK 1.6 is used?

The testsuite was run 10 times (all tests pass) :
using Fedora release 20 (Heisenbug)
and java version "1.6.0"
[
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64   jvmxa6460sr16-20140626_204542 (JIT enabled, AOT enabled)
J9VM - 20140626_204542
JIT  - r9_20130920_46510ifx7
GC   - GA24_Java6_SR16_20140626_1848_B204542)
]

Could I have a clone of this job to run it on Jenkins?

Comment 7 Petr Kremensky 2014-11-12 14:55:17 UTC
The problem with all these intermittent failures is that they occurs only from time to time so it's a quite challenge to find a reproducer sometimes (and this one I see quite rarely).

We are using following IBM build:
1.6.0 build 20140418_01 (SR16)

I've created a new job you can use (feel free to make any configuration changes).
https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/eap-640-as-testsuite-bz1100839-datasource-smoke-ibm/ however Jenkins is a little bit overloaded so no results yet. I'll try to run it few times to see we can run into it.

FYI:
*prepare.zip used by job contains compiled sources, local maven repo and jboss distribution.

Comment 8 Panagiotis Sotiropoulos 2014-11-17 11:16:04 UTC
Could I have permission to upload another IBM JDK 1.6 build on Jenkins?
Do you notice the same issue also when you build wildfly?

Comment 9 Petr Kremensky 2014-11-18 06:42:52 UTC
You can upload jdk by yourself (use /home/hudson/users-tmp/$USER_NAME folder) and set it on PATH manually in job's configuration (this way you don't have to create any tickets and wait).

We don't run any CI jobs with WF. You may ask people around WF like Stuart Douglas or so.

Comment 10 JBoss JIRA Server 2014-11-20 09:38:56 UTC
Panagiotis Sotiropoulos <panossot> updated the status of jira JBTEST-21 to Closed

Comment 11 Panagiotis Sotiropoulos 2014-11-20 12:52:32 UTC
Adding <runOrder>alphabetical</runOrder> in the surefire configuration in the smoke pom seams to be a workaround.

Comment 12 Panagiotis Sotiropoulos 2014-11-20 12:59:26 UTC
thx Petr for the help

Comment 14 Tomas Hofman 2014-11-21 16:01:29 UTC
Caused by: java.lang.NoClassDefFoundError: com/mysql/jdbc/StringUtils
	at com.mysql.jdbc.NonRegisteringDriver.parseURL(NonRegisteringDriver.java:582)
	at com.mysql.jdbc.NonRegisteringDriver.acceptsURL(NonRegisteringDriver.java:236)
	at java.sql.DriverManager.getDriver(DriverManager.java:495) [sql.jar:]
	at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.isDriverLoadedForURL(LocalManagedConnectionFactory.java:671)
	at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getDriver(LocalManagedConnectionFactory.java:645)
	at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:320)


DriverManager.getDriver(url) in LocalManagedConnectionFactory:671 is given url argument "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE", while it produces exception about com.mysql.jdbc.StringUtils. That seems like that is a bug in IBM JDK.

Comment 15 Panagiotis Sotiropoulos 2014-11-22 15:41:23 UTC
PR of workaround sent : https://github.com/jbossas/jboss-eap/pull/2044

Comment 16 JBoss JIRA Server 2014-11-22 15:43:39 UTC
Panagiotis Sotiropoulos <panossot> updated the status of jira JBQA-10003 to Coding In Progress

Comment 17 JBoss JIRA Server 2014-11-22 15:43:50 UTC
Panagiotis Sotiropoulos <panossot> updated the status of jira JBQA-10003 to Open

Comment 18 JBoss JIRA Server 2014-11-22 15:44:38 UTC
Panagiotis Sotiropoulos <panossot> updated the status of jira JBQA-10003 to Resolved

Comment 19 Kabir Khan 2014-11-24 08:19:16 UTC
https://github.com/jbossas/jboss-eap/pull/2044

Comment 21 Panagiotis Sotiropoulos 2014-12-01 07:16:39 UTC
The error is caused inside the IBM JDK 1.6 DriverManager.getDriver class. 
An exception is not caught by isDriverLoadedForURL class (ironjacamar - adapters).

Code :
driver = (Driver)clazz.newInstance();
DriverManager.registerDriver(driver);
is never executed.

Comment 22 Panagiotis Sotiropoulos 2014-12-04 10:21:38 UTC
PR: https://github.com/ironjacamar/ironjacamar/pull/265

Comment 27 Panagiotis Sotiropoulos 2015-01-05 12:16:31 UTC
https://developer.jboss.org/message/914952#914952

Comment 29 Panagiotis Sotiropoulos 2015-03-12 13:53:26 UTC
If tested with unmanaged container all the tests succeed.

Comment 30 Panagiotis Sotiropoulos 2015-03-16 11:31:51 UTC
PR sent : https://github.com/ironjacamar/ironjacamar/pull/304

Fixes the IBM JDK 1.6 issue by getting the LocalManagedConnection after reloading the driver when the first try fails.

Comment 31 Carlo de Wolf 2015-03-23 13:47:02 UTC
Triage: it is not a common occurrence to install a new driver version and not expect a server restart (i.c.w. IBM JDK 6)