| Summary: | driverTemplate's jarList attribute doesn't support multiple jars in the format of [plugin]/jar | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Data Tools | Reporter: | Shenxue Zhou <shenxue.zhou> | ||||
| Component: | Connectivity | Assignee: | Brian Fitzpatrick <bfitzpat> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | 1.7 | ||||||
| Target Milestone: | 1.8.2 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Shenxue Zhou
I'll take a look at this one. Created attachment 181231 [details]
Partial fix to parse multiple jars
Brain, I just attached a patch which fixed the parsing of multiple jar files. But it's only a partial fix to the problem. In [workspace]\.metadata\.plugins\org.eclipse.datatools.connectivity\driverStorage.xml, prop_jarList only listed one jar file. What I need is to be able to specify multiple jar files in the jarList and when creating connections, the passed class loader would contain the multiple jar file paths. Do you have an estimate on how soon this can be fixed? I'm blocked by this... Thanks! Shenxue The earliest it could be fixed would be in the 1.8.2 stream, which will release in February. I'll see if I can get something working in the next couple of days so you can test it with nightly builds at least. That's weird. With your patch on linux, it works fine with my sample with three jars...
It goes from this in the plugin.xml:
jarList="[org.eclipse.datatools.mysql.wrapper]/lib/mysql-connector-java-5.1.13-bin.jar;[org.eclipse.datatools.mysql.wrapper]/lib/sqljdbc.jar;[org.eclipse.datatools.mysql.wrapper]/lib/sqljdbc4.jar"
To this in the driverStorage.xml:
prop_jarList="/NotBackedUp/bfitzpat/workspaces/newwsJune222010/org.eclipse.datatools.mysql.wrapper/lib/mysql-connector-java-5.1.13-bin.jar:/NotBackedUp/bfitzpat/workspaces/newwsJune222010/org.eclipse.datatools.mysql.wrapper/lib/sqljdbc.jar:/NotBackedUp/bfitzpat/workspaces/newwsJune222010/org.eclipse.datatools.mysql.wrapper/lib/sqljdbc4.jar"
Now I haven't tried loading the multiple jars yet. And I don't have anything to test against - no Oracle dbs and I don't have the multi-jar driver for Oracle. Is there an easy way for me to try and reproduce this?
Now keep in mind I'm trying on the trunk stream (1.9) which may have a few fixes since 1.7... Brian, The partial fix I made was based on the HEAD (TRUNK) branch. I just tried it again in a brand new space and I'm still only seeing one one jar file in the prop_jarList field of the driverStorage.xml. Could you try bringing up "Edit Driver Definition" dlg? Do you see multiple jar files in the JAR List tab? I only see one. I'm running on windows XP. I wonder whether the platform difference is contributing to this issue. Just glancing the DriverManager class, it uses path delimiters. I don't have another way to reproduce it other than using oracle db. When we can get past the above issue and you're ready to add the multiple jars to the class loader, I'd be happy to test your patch. Does this work for you? Thank you so much! Shenxue Yeah, I see multiple jars in the edit driver definition. And yes, DriverManager does use path delimiters, but if you look to the top, public static final String PATH_DELIMITER = "" + File.pathSeparatorChar; //$NON-NLS-1$ public static final char PATH_DELIMITER_CHAR = File.pathSeparatorChar; So we should be ok from a platform-specific file path perspective. Where can I grab the Oracle drivers from and I'll see if I can reproduce what you're seeing here, minus the class loader parts... And as far as the classloader goes, if you looke at org.eclipse.datatools.connectivity.drivers.jdbc.JDBCConnection, it has a method getJarListAsArray that should be parsing the entire list and adding it to the URL class loader down below in createClassLoader(ClassLoader parentCL) Brian, Yes I do see that path delimiter should not contribute to the problem. My problem was actually caused by a driver migration class that I forgot about. Now that I fixed the problem in the migration class, I do see three jars in my jar list and the driverStorage.xml. Sorry for the confusion. I'll test the driver class loader and let you know how it goes. Thanks! Shenxue (In reply to comment #9) > Brian, > > Yes I do see that path delimiter should not contribute to the problem. > > My problem was actually caused by a driver migration class that I forgot about. > Now that I fixed the problem in the migration class, I do see three jars in my > jar list and the driverStorage.xml. Sorry for the confusion. > > I'll test the driver class loader and let you know how it goes. > > Thanks! > > Shenxue Brian, I just tested the driver class loader and verified that it contained three jar file paths and it worked as expected. So once you apply the patch I submitted, then you can consider this bug fixed. Thanks, Shenxue Delivered to o.e.d.connectivity in HEAD as tag v201010220349 Delivering to 1.8.2 branch next... Delivered to 1.8.2 branch - o.e.d.connectivity tag v201010220354 Thanks for the patch Shenxue! |