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.
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)
Created attachment 59781 [details] stacktrace
Do you have a workaround - are you able to add the driver at all? If not, this may be a P1...
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.
OK, thanks.
This issue has already 5 duplicates
Please fix this for 6.5 it is highly visible and seems as simplefix..
Sounds reasonable, let's see if we can do this.
Hm, I can't reproduce on the Mac. Where exactly did you place the new driver in your filesystem?
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).
> 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.
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:)
OK, Andrei's comments make sense, I'll take a look at transforming nbinst: URL to file: URL.
*** Issue 141702 has been marked as a duplicate of this issue. ***
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.
Sorry I didn't respond sooner, I was in a lunch meeting. Confirmed, I'm not working on it
ce2a3d27d394
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.
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.
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.
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.
178f56acf5ac
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.
Verified with build 080910.