Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DE40210950 for ; Tue, 4 Feb 2014 23:55:14 +0000 (UTC) Received: (qmail 89342 invoked by uid 500); 4 Feb 2014 23:55:11 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 88949 invoked by uid 500); 4 Feb 2014 23:55:11 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 88795 invoked by uid 500); 4 Feb 2014 23:55:10 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 88675 invoked by uid 99); 4 Feb 2014 23:55:09 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Feb 2014 23:55:09 +0000 Date: Tue, 4 Feb 2014 23:55:09 +0000 (UTC) From: "Brian Muray (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-6363) IllegalArgumentException is thrown instead of SQLException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-6363?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13891= 462#comment-13891462 ]=20 Brian Muray commented on HIVE-6363: ----------------------------------- A similar issue was fixed in HIVE-4194. The changes were overwritten by th= e changes to HIVE-4802. > IllegalArgumentException is thrown instead of SQLException > ---------------------------------------------------------- > > Key: HIVE-6363 > URL: https://issues.apache.org/jira/browse/HIVE-6363 > Project: Hive > Issue Type: Bug > Components: JDBC > Affects Versions: 0.10.0, 0.11.0, 0.12.0 > Reporter: chandra sekhar gunturi > Priority: Critical > Labels: JDBC, unit-test > Attachments: HIVE-6363.patch.1.txt, HIVE-6363.patch.2.txt > > Original Estimate: 24h > Remaining Estimate: 24h > > parseURL in the following code is throwing IllegalArgumentException=20 > http://svn.apache.org/viewvc/hive/trunk/jdbc/src/java/org/apache/hive/jdb= c/Utils.java?view=3Dmarkup=20 > This is going to break other JDBC based connectors because java.sql.Drive= rManager doesn=E2=80=99t catch IllegalArgumentException while probing for c= orrect Driver for a given URL.=20 > A simple test case can have class.forName(org.apache.hive.jdbc.HiveDriver= ) (Loading hiveserver2 JDBC driver) followed by class.forName(org.apache.ha= doop.hive.jdbc.HiveDriver)(Loading hiveserver JDBC driver). > In this case hiveserver connection will fail with BAD URL format for hive= server. If you reverse the driver loading to hiveserver followed by hiveser= ver2, both the connections will be successful. > Following code in java.sql.DriverManager is causing the issue=20 > [[=20 > // Worker method called by the public getConnection() methods.=20 > private static Connection getConnection(=20 > // Walk through the loaded registeredDrivers attempting to make a connect= ion.=20 > // Remember the first exception that gets raised so we can reraise it.=20 > for(DriverInfo aDriver : registeredDrivers) {=20 > // If the caller does not have permission to load the driver then=20 > // skip it.=20 > if(isDriverAllowed(aDriver.driver, callerCL)) {=20 > try {=20 > Connection con =3D aDriver.driver.connect(url, info);=20 > if (con !=3D null) {=20 > // Success!=20 > println("getConnection returning " + aDriver.driver.getClass().getName())= ;=20 > return (con);=20 > }=20 > } catch (SQLException ex) {=20 > if (reason =3D=3D null) {=20 > reason =3D ex;=20 > }=20 > }=20 > } else {=20 > println(" skipping: " + aDriver.getClass().getName());=20 > }=20 > }=20 > }=20 > ]]=20 > Marking it as critical because this is going to restrict consuming JDBC d= river in production environment where many drivers are loaded on requiremen= t rather than statically loading all drivers. -- This message was sent by Atlassian JIRA (v6.1.5#6160)