Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1090930

Summary: Catch the exceptions thrown by JDBC driver validator
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Petr Kremensky <pkremens>
Component: InstallerAssignee: Thomas Hauser <thauser>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0   
Target Milestone: ER3   
Target Release: EAP 6.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-28 15:28:16 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:
Attachments:
Description Flags
Invalid jar file none

Description Petr Kremensky 2014-04-24 12:15:35 UTC
Created attachment 889263 [details]
Invalid jar file

Description of problem:
 In some installer tests I am using lightweight versions of JDBC driver jars (only requested classes are presented). Jar validation has changed between 6.2.0 and 6.3.0 which is good, but installer sometimes thrown an Exception and literally stuck if the jar is invalid. User could run into this if his jar is corrupted in some way. Installer should catch these exceptions and thrown some warning|error dialogue saying that jar cannot be used.

Version-Release number of selected component (if applicable):
 EAP 6.3.0.ER2

How reproducible:
 Always

Steps to Reproduce:
 0. Download the invalid jar from attachment
 1. Run gui installer, go to Configure runtome screen, choose to Perform advanced configuration -> Install JDBC Driver
 2. Select Sybase from driver vendor menu, enter path to sybase-dummy.jar and press Next

Actual results:
 Installer stuck, console output:
Exception in thread "Thread-12" java.lang.NoClassDefFoundError: com/sybase/jdbcx/SybDriver
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at com.redhat.installer.util.JDBCConnectionUtils.findDriverClass(JDBCConnectionUtils.java:187)
	at com.redhat.installer.panels.JBossJDBCDriverSetupPanel$JDBCPanel.verifyDriver(JBossJDBCDriverSetupPanel.java:541)
	at com.redhat.installer.panels.JBossJDBCDriverSetupPanel$JDBCPanel.validated(JBossJDBCDriverSetupPanel.java:465)
	at com.redhat.installer.panels.JBossJDBCDriverSetupPanel.isValidated(JBossJDBCDriverSetupPanel.java:85)
	at com.izforge.izpack.installer.IzPanel.panelValidated(IzPanel.java:440)
	at com.izforge.izpack.installer.InstallerFrame.navigateNext(InstallerFrame.java:1665)
	at com.izforge.izpack.installer.InstallerFrame.navigateNext(InstallerFrame.java:1650)
	at com.izforge.izpack.installer.InstallerFrame$NavigationHandler.navigate(InstallerFrame.java:1815)
	at com.izforge.izpack.installer.InstallerFrame$NavigationHandler.access$100(InstallerFrame.java:1782)
	at com.izforge.izpack.installer.InstallerFrame$NavigationHandler$1.run(InstallerFrame.java:1799)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: com.sybase.jdbcx.SybDriver
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	... 23 more 

Expected results:
 Warning|Error dialogue is thrown saying that user cannot use this jar

Comment 1 Thomas Hauser 2014-04-24 15:09:19 UTC
This exception is thrown because the installer actually loads the class, and classes needed by the class that is being loaded don't exist in the jar, so it fails with the NoClassDefFoundError. This situation wasn't accounted for previously. The same warning is displayed as if the user specifies a jar that doesn't contain the class (as the loading of the class has failed).

Comment 2 Petr Kremensky 2014-05-07 12:16:24 UTC
Verified on EAP 6.3.0.ER3 installer.