This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 132222 - IllegalArgumentException: URI scheme is not "file"
Summary: IllegalArgumentException: URI scheme is not "file"
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Rob Englander
URL: http://statistics.netbeans.org/except...
Keywords:
: 141702 (view as bug list)
Depends on:
Blocks: 129908
  Show dependency tree
 
Reported: 2008-04-07 17:14 UTC by Tomas Danek
Modified: 2008-09-11 16:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 9518


Attachments
stacktrace (5.86 KB, text/plain)
2008-04-07 17:14 UTC, Tomas Danek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2008-04-07 17:14:26 UTC
Build: NetBeans IDE Dev (Build 200804060002)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_04-b12
OS: Linux, 2.6.22-14-generic, i386

User Comments: 
added new DB driver file (invoked on MYSQL customize and added new JAR)
Comment 1 Tomas Danek 2008-04-07 17:14:32 UTC
Created attachment 59781 [details]
stacktrace
Comment 2 David Vancouvering 2008-04-07 23:58:07 UTC
Do you have a workaround - are you able to add the driver at all?  If not, this may be a P1...
Comment 3 Tomas Danek 2008-04-08 07:45:59 UTC
yes i have, all i wanted to do is replace driver bundled with ide with my own (older version). During adding my own
driver was IAE thrown, but driver was added, and original could be removed, so i did not notice any impact of this
exception.
Comment 4 David Vancouvering 2008-04-08 19:00:05 UTC
OK, thanks.
Comment 5 Exceptions Reporter 2008-05-27 21:45:45 UTC
This issue has already 5 duplicates 
Comment 6 Tomas Danek 2008-08-13 17:19:19 UTC
Please fix this for 6.5 it is highly visible and seems as simplefix..
Comment 7 David Vancouvering 2008-08-13 17:54:49 UTC
Sounds reasonable, let's see if we can do this.
Comment 8 David Vancouvering 2008-08-16 00:33:42 UTC
Hm, I can't reproduce on the Mac.  Where exactly did you place the new driver in your filesystem?
Comment 9 David Vancouvering 2008-08-16 00:45:06 UTC
Never mind, I reproduced.  

I don't see any value in having two driver jars for two different versions in the same driver definition.  I'm not sure
why this was implemented in the first place.  It seems to me that if you want to have two different driver jars
supported, then you create two different driver definitions, one for each jar file.

I also noticed that having two driver jars in the same driver definition causes confusion for the new New Connection
dialog, because the drop-down includes two drivers with exactly the same name.

So first of all, I propose we not make it possible to have more than one jar file for a given driver definition.  I'll
check with Andrei on this and see if he understands why this might still be needed, but otherwise out it goes.

After that, it seems to me there are two choices:

(a) let you replace the jar file that's there in an existing driver definition (it would say "are you sure you want to
replace the existing driver jar with this new one?")

(b) don't let you change anything at all and require you to create a new driver node and remove the old one

I think the simpler conceptual model is actually (b), but I can see why supporting (a) might be attractive.

Comments on this most appreciated, I'll wait to hear back from you before I take a particular choice on this.  If I
don't hear back from you, I'll choose (b).
Comment 10 Andrei Badea 2008-08-18 10:32:47 UTC
> So first of all, I propose we not make it possible to have more than one jar file for a given driver definition.

Not doable, the Microsoft SQL Server 2000 JDBC driver comes with three jar files. 

Also, this doesn't really solve the problem, which is that a nbinst: URL is not transformed to a file: URL, as is done
in the constructor of AddDriverDialog. That is what needs to be solved in this issue. The user confusion when replacing
the bundled MySQL driver is a different thing, and I don't think it needs to be addressed at all.
Comment 11 Tomas Danek 2008-08-18 15:44:11 UTC
well, the problem here seems to be only that if you initially hit Remove button, no item in list is selected, when you
first select driver in list and then remove, no exception is thrown:)
Comment 12 David Vancouvering 2008-08-18 21:15:35 UTC
OK, Andrei's comments make sense, I'll take a look at transforming nbinst: URL to file: URL.
Comment 13 John Baker 2008-08-30 07:53:57 UTC
*** Issue 141702 has been marked as a duplicate of this issue. ***
Comment 14 Rob Englander 2008-09-04 21:22:17 UTC
David, if you're not already working on this I'll fix it.  There's no need to rework the URI.  The method being called
is not needed.  There's another method in the class that uses reflection to accomplish the same task.  These methods
simply need to be refactored into 1.

There's also another bug that the reporter has sort of pointed out -- that the Remove button shouldn't even be enabled
when no driver file is selected in the list.  I'll fix that as well.

So just confirm that you're not already doing the fix and I'll take care of this.
Comment 15 David Vancouvering 2008-09-04 22:00:44 UTC
Sorry I didn't respond sooner, I was in a lunch meeting.  Confirmed, I'm not working on it
Comment 16 Rob Englander 2008-09-05 00:48:40 UTC
ce2a3d27d394
Comment 17 Andrei Badea 2008-09-05 09:29:56 UTC
Sorry, I do not agree with this change. Before the change, a quick search based on a known list of driver classes was
performed when adding a driver class. Now that doens't happen anymore -- instead, the deeper search with URLClassLoader
and JarFile is performed. The performance of this search is wrose: it is slower and it loads the driver classes. Many
users might perceive this as a regression, because before the change the driver class was located very quickly for most
drivers.
Comment 18 Rob Englander 2008-09-05 13:36:31 UTC
No problem.  I'll convert the nbinst url.  

Just a note:  As a user, I found the use of the Find button confusing.  If the dialog is already showing me the driver
classes for the loaded files, why would I ever click Find?  And although there's a good attempt at loading driver
classes from a predefined list, that leads to more confusion for those that do not find the driver classes they expect
if they aren't in our list.  Since there's no Help on this dialog, the user is lost.  I ran some timing tests before I
made the change and I didn't find the performance hit to be unreasonable.  It took about 25ms on my Mac to load the
driver classes using Introspection.  I think the perceived performance hit is due to the progress bar being added to the
UI during that operation.

Anyway, I have the change and will commit today.
Comment 19 Andrei Badea 2008-09-05 14:32:05 UTC
Not sure I agree about the confusion. If the driver is there, you can just ignore Find. If the driver is not there, you
tell the dialog to Find it by pressing the button. The idea is to avoid the need to press Find for most users, but offer
a way proceed for an exotic driver we don't know about.

Regarding the performance: some drivers are quite small, but others are quite big (like the MS SQL Server driver, which
comes with three jar files). Another problem is loading the classes in the NetBeans JVM, which is better avoid unless
absolutely necessary.
Comment 20 Quality Engineering 2008-09-05 17:31:07 UTC
Integrated into 'main-golden', will be available in build *200809051401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/ce2a3d27d394
User: Rob Englander <mindstream@netbeans.org>
Log: #132222 Refactored to use single correct code block for finding driver classes.  Manage Remove and Find button states based on file list content and selection.
Comment 21 Rob Englander 2008-09-05 18:08:57 UTC
178f56acf5ac
Comment 22 Quality Engineering 2008-09-06 05:22:51 UTC
Integrated into 'main-golden', will be available in build *200809060201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/178f56acf5ac
User: Rob Englander <mindstream@netbeans.org>
Log: #132222 Use driver lookup except for Find button processing.
Comment 23 Roman Mostyka 2008-09-11 16:04:11 UTC
Verified with build 080910.