Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Driver Definition/pre-loading JDBC drivers
Driver Definition/pre-loading JDBC drivers [message #546870] Wed, 14 July 2010 13:23 Go to next message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
Hey all,
Carry over from this post: https://community.jboss.org/message/552408

Getting into some DTP specific talk, so taking it to this list! Smile


My intent is to find a way to have 'portable' jdbc driver support in the Eclipse Preferences->DataManagement->Connectivity->Driver Definition section (i.e. not require file-system setup of the jdbc jars). These are for the mysql, ms-sql (whether jtds or sqljdbc.jar, depending on project), postgres, etc.

Fitz has helped out greatly to-date in the approach of using an eclipse plugin approach to provide the default jdbc jar and override the template to point to the plugin/jdbc jar location. Now at the point where getting the following errors:

for plugin name "com.mycompany.eclipse.jdbc.mysql", exporting as jar plugin to eclipse/plugins location, and using Driver Definition it says in the jarlist " [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java- 5.1.6.jar "

ERROR: "File com.mycompany.eclipse.jdbc.mysql/lib/mysql-connector-java-5. 1.6.jar missing while setting up default driver definitions"

I've tried making this both as an eclipse plugin, and an OSGI:Equinox plugin, but behaving the same.


MANIFEST.MF (abbreviated)
==============================
Bundle-SymbolicName: com.mycompany.eclipse.jdbc.mysql;singleton:=true
Bundle-Version: 5.1.6
Bundle-Vendor: mycompany
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.osgi.framework;version="1.3.0"
Require-Bundle: org.eclipse.ui.ide,
org.eclipse.core.resources
Bundle-ClassPath: lib/mysql-connector-java-5.1.6.jar,
.
===============================


plugin.xml
===========================
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.datatools.connectivity.driverExtension">
<driverTemplateOverride
createDefault="true"
jarList=" [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java- 5.1.6.jar "
priority="1"
targetId="org.eclipse.datatools.enablement.mysql.5_1.driverTemplate ">
</driverTemplateOverride>
</extension>

</plugin>
===========================

build.properties
===========================
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
lib/mysql-connector-java-5.1.6.jar
===========================


Thanks, it feels sooo close!

((note: there are no extra spaces in the actual implementation, even though it may display as such)).

Re: Driver Definition/pre-loading JDBC drivers [message #546921 is a reply to message #546870] Wed, 14 July 2010 15:22 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
Did you try flipping the slashes the other way? I hate to say it, but
that code may be slash stupid. :(

I'm on Linux, so I can't try it right now.

--Fitz

dhartford wrote:
> Hey all,
> Carry over from this post: https://community.jboss.org/message/552408
>
> Getting into some DTP specific talk, so taking it to this list! :)
>
>
> My intent is to find a way to have 'portable' jdbc driver support in the
> Eclipse Preferences->DataManagement->Connectivity->Driver Definition
> section (i.e. not require file-system setup of the jdbc jars). These
> are for the mysql, ms-sql (whether jtds or sqljdbc.jar, depending on
> project), postgres, etc.
>
> Fitz has helped out greatly to-date in the approach of using an eclipse
> plugin approach to provide the default jdbc jar and override the
> template to point to the plugin/jdbc jar location. Now at the point
> where getting the following errors:
>
> for plugin name "com.mycompany.eclipse.jdbc.mysql", exporting as jar
> plugin to eclipse/plugins location, and using Driver Definition it says
> in the jarlist "
> [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java- 5.1.6.jar "
>
> ERROR: "File
> com.mycompany.eclipse.jdbc.mysql/lib/mysql-connector-java-5. 1.6.jar
> missing while setting up default driver definitions"
>
> I've tried making this both as an eclipse plugin, and an OSGI:Equinox
> plugin, but behaving the same.
>
>
> MANIFEST.MF (abbreviated)
> ==============================
> Bundle-SymbolicName: com.mycompany.eclipse.jdbc.mysql;singleton:=true
> Bundle-Version: 5.1.6
> Bundle-Vendor: mycompany
> Bundle-RequiredExecutionEnvironment: J2SE-1.5
> Import-Package: org.osgi.framework;version="1.3.0"
> Require-Bundle: org.eclipse.ui.ide,
> org.eclipse.core.resources
> Bundle-ClassPath: lib/mysql-connector-java-5.1.6.jar,
> .
> ===============================
>
>
> plugin.xml
> ===========================
> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.4"?>
> <plugin>
> <extension
> point="org.eclipse.datatools.connectivity.driverExtension">
> <driverTemplateOverride
> createDefault="true"
> jarList="
> [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java- 5.1.6.jar "
> priority="1"
>
> targetId="org.eclipse.datatools.enablement.mysql.5_1.driverTemplate ">
> </driverTemplateOverride>
> </extension>
> </plugin>
> ===========================
>
> build.properties
> ===========================
> source.. = src/
> output.. = bin/
> bin.includes = META-INF/,\
> .,\
> plugin.xml,\
> lib/mysql-connector-java-5.1.6.jar
> ===========================
>
>
> Thanks, it feels sooo close!
>
> ((note: there are no extra spaces in the actual implementation, even
> though it may display as such)).
>
>
Re: Driver Definition/pre-loading JDBC drivers [message #546922 is a reply to message #546921] Wed, 14 July 2010 15:25 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
Wait, that's probably not it based on the error you're seeing.

I've not tried this in Eclipse 3.4 in a long time and don't have an
environment, but you may have hit upon a bug. And we're not updating
that version any more.

What plug-in versions are you going against for the
org.eclipse.datatools.connectivity plug-in? Is it 1.6?

--Fitz

Brian Fitzpatrick wrote:
> Did you try flipping the slashes the other way? I hate to say it, but
> that code may be slash stupid. :(
>
> I'm on Linux, so I can't try it right now.
>
> --Fitz
>
> dhartford wrote:
>> Hey all,
>> Carry over from this post: https://community.jboss.org/message/552408
>>
>> Getting into some DTP specific talk, so taking it to this list! :)
>>
>>
>> My intent is to find a way to have 'portable' jdbc driver support in
>> the Eclipse Preferences->DataManagement->Connectivity->Driver
>> Definition section (i.e. not require file-system setup of the jdbc
>> jars). These are for the mysql, ms-sql (whether jtds or sqljdbc.jar,
>> depending on project), postgres, etc.
>>
>> Fitz has helped out greatly to-date in the approach of using an
>> eclipse plugin approach to provide the default jdbc jar and override
>> the template to point to the plugin/jdbc jar location. Now at the
>> point where getting the following errors:
>>
>> for plugin name "com.mycompany.eclipse.jdbc.mysql", exporting as jar
>> plugin to eclipse/plugins location, and using Driver Definition it
>> says in the jarlist "
>> [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java- 5.1.6.jar "
>>
>> ERROR: "File
>> com.mycompany.eclipse.jdbc.mysql/lib/mysql-connector-java-5. 1.6.jar
>> missing while setting up default driver definitions"
>>
>> I've tried making this both as an eclipse plugin, and an OSGI:Equinox
>> plugin, but behaving the same.
>>
>>
>> MANIFEST.MF (abbreviated)
>> ==============================
>> Bundle-SymbolicName: com.mycompany.eclipse.jdbc.mysql;singleton:=true
>> Bundle-Version: 5.1.6
>> Bundle-Vendor: mycompany
>> Bundle-RequiredExecutionEnvironment: J2SE-1.5
>> Import-Package: org.osgi.framework;version="1.3.0"
>> Require-Bundle: org.eclipse.ui.ide,
>> org.eclipse.core.resources
>> Bundle-ClassPath: lib/mysql-connector-java-5.1.6.jar,
>> .
>> ===============================
>>
>>
>> plugin.xml
>> ===========================
>> <?xml version="1.0" encoding="UTF-8"?>
>> <?eclipse version="3.4"?>
>> <plugin>
>> <extension
>> point="org.eclipse.datatools.connectivity.driverExtension">
>> <driverTemplateOverride
>> createDefault="true"
>> jarList="
>> [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java- 5.1.6.jar "
>> priority="1"
>>
>> targetId="org.eclipse.datatools.enablement.mysql.5_1.driverTemplate ">
>> </driverTemplateOverride>
>> </extension>
>> </plugin>
>> ===========================
>>
>> build.properties
>> ===========================
>> source.. = src/
>> output.. = bin/
>> bin.includes = META-INF/,\
>> .,\
>> plugin.xml,\
>> lib/mysql-connector-java-5.1.6.jar
>> ===========================
>>
>>
>> Thanks, it feels sooo close!
>>
>> ((note: there are no extra spaces in the actual implementation, even
>> though it may display as such)).
>>
>>
Re: Driver Definition/pre-loading JDBC drivers [message #546925 is a reply to message #546922] Wed, 14 July 2010 16:00 Go to previous messageGo to next message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
The environment/versions are:

DTP 1.7.0 (v200906***)

Tested both:
*Eclipse 3.6/Win7
*Eclipse 3.5/Fedora12

And I did try slashes both ways in the windows environments, but I only tried the '/' approach in linux.
Re: Driver Definition/pre-loading JDBC drivers [message #546961 is a reply to message #546925] Wed, 14 July 2010 18:01 Go to previous messageGo to next message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
Tested DTP 1.7.2 (200909***) just to be sure, same symptoms.

Unable to test DTP 1.8 at this time (only on eclipse 3.5 currently where I am).
Re: Driver Definition/pre-loading JDBC drivers [message #547006 is a reply to message #546961] Wed, 14 July 2010 23:12 Go to previous messageGo to next message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
Eclipse 3.6/DTP 1.8.0 (201005****) also same symptoms (windows)
Re: Driver Definition/pre-loading JDBC drivers [message #547139 is a reply to message #547006] Thu, 15 July 2010 16:23 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
dhartford wrote:
> Eclipse 3.6/DTP 1.8.0 (201005****) also same symptoms (windows)
Try exporting all the classes in the jar that you're exposing in your
plug-in wrapper. I think that's the only thing I'm seeing different
between what you're doing and what I did.
Re: Driver Definition/pre-loading JDBC drivers [message #547352 is a reply to message #547139] Fri, 16 July 2010 12:38 Go to previous messageGo to next message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
That doesn't seem to work out, as since this approach overrides the template to define where the jar is (by providing a new jarList default value), not sure how that would work out.

What would you use for this line in that scenario?

jarList=" [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java- 5.1.6.jar "
Re: Driver Definition/pre-loading JDBC drivers [message #547394 is a reply to message #547352] Fri, 16 July 2010 14:33 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
If the classes aren't exposed via the manifest when you expose the jar,
it's not actually loading those classes into the Eclipse classloader.

That said, I've created a wrapper that works locally for me on Linux and
stuffed it up here in a zip file: http://drop.io/zgz4xew

See if you can figure out what the diffs are between what you've done
and how I implemented it and maybe we can document this a bit better so
others trying to do the same thing can repeat the process?

--Fitz

dhartford wrote:
> That doesn't seem to work out, as since this approach overrides the
> template to define where the jar is (by providing a new jarList default
> value), not sure how that would work out.
>
> What would you use for this line in that scenario?
>
> jarList=" [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java-
> 5.1.6.jar "
>
Re: Driver Definition/pre-loading JDBC drivers [message #547420 is a reply to message #547394] Fri, 16 July 2010 17:29 Go to previous messageGo to next message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
I really wish I could say 'yeah', but something is missing --

Fresh Helios-JEE install (v20100617), DTP 1.80(v20100528), on fedora 12 w/openjdk 1.6.0_18 using the file downloaded from above.

"Unable to locate JAR/zip in file system as specified by the driver definition: [org.eclipse.datatools.mysql.wrapper]/lib/mysql-connector-ja va-5.1.13-bin.jar. "

Are you using a trunk or nightly version of DTP?

EDIT: if it matters, I'm doing an 'Export->plugin as deployable' to create a jar and putting that jar in the Eclipse/plugin directory location.

[Updated on: Fri, 16 July 2010 17:57]

Report message to a moderator

Re: Driver Definition/pre-loading JDBC drivers [message #547446 is a reply to message #547420] Fri, 16 July 2010 20:00 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
Trunk, but that code hasn't changed at all since probably 1.7

You're not seeing anything worthwhile in the log or console other than
that "Unable to locate JAR/zip in file system as specified by the driver
definition" message?

dhartford wrote:
> I really wish I could say 'yeah', but something is missing --
>
> Fresh Helios-JEE install (v20100617), DTP 1.80(v20100528), on fedora 12
> w/openjdk 1.6.0_18 using the file downloaded from above.
>
> "Unable to locate JAR/zip in file system as specified by the driver
> definition:
> [org.eclipse.datatools.mysql.wrapper]/lib/mysql-connector-ja
> va-5.1.13-bin.jar. "
>
> Are you using a trunk or nightly version of DTP?
Re: Driver Definition/pre-loading JDBC drivers [message #547718 is a reply to message #547446] Mon, 19 July 2010 13:31 Go to previous messageGo to next message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
In the Error Log view:
====================

eclipse.buildId=I20100608-0911
java.version=1.6.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.jee.product


Error
Mon Jul 19 09:24:25 EDT 2010
File org.eclipse.datatools.mysql.wrapper/lib/mysql-connector-java -5.1.13-bin.jar missing while setting up default driver definitions.

===================


Everything seems fine, just appears that whatever mechanism is loading the jarList doesn't understand the plugin-access approach. Using the code as-is that you provided above, I clean out the eclipse plugins folder of any old ones then I just right-click on the project, export, PDE->Deployable plugins and fragments, make sure the wrapper is checked (and only one checked), destination directly under the eclipse plugin location, finish.


Re: Driver Definition/pre-loading JDBC drivers [message #548153 is a reply to message #547718] Tue, 20 July 2010 20:09 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
Ok, well... I looked back in Bugzilla and we haven't had any issues
reported with this functionality since 1.6, so I'm still not sure what's
going on. I'm able to get this working just fine and BIRT's been using
this functionality for quite a while now with no issues.

I'm out of ideas...

This extension point implementation...

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.datatools.connectivity.driverExtension">
<driverTemplateOverride
createDefault="true"

jarList=" [org.eclipse.datatools.mysql.wrapper]/lib/mysql-connector-ja va-5.1.13-bin.jar "
priority="1"

targetId="org.eclipse.datatools.enablement.mysql.5_1.driverTemplate ">
</driverTemplateOverride>
</extension>
</plugin>

This is my wrapper MANIFEST.MF file:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MySQL JDBC Driver Wrapper
Bundle-SymbolicName: org.eclipse.datatools.mysql.wrapper;singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: lib/mysql-connector-java-5.1.13-bin.jar
Bundle-Vendor: Eclipse.org
Export-Package: com.mysql.jdbc,
com.mysql.jdbc.exceptions,
com.mysql.jdbc.exceptions.jdbc4,
com.mysql.jdbc.integration.c3p0,
com.mysql.jdbc.integration.jboss,
com.mysql.jdbc.interceptors,
com.mysql.jdbc.jdbc2.optional,
com.mysql.jdbc.jmx,
com.mysql.jdbc.log,
com.mysql.jdbc.profiler,
com.mysql.jdbc.util,
org.gjt.mm.mysql
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.datatools.connectivity

And the build.properties:

bin.includes = META-INF/,\
lib/mysql-connector-java-5.1.13-bin.jar,\
plugin.xml

And it all just works just fine for me.

Can you download Eclipse 3.5 or 3.6 and see if you have the same issues?
Maybe it's related to Eclipse 3.4?

--Fitz

dhartford wrote:
> In the Error Log view:
> ====================
>
> eclipse.buildId=I20100608-0911
> java.version=1.6.0_18
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
> Framework arguments: -product org.eclipse.epp.package.jee.product
> Command-line arguments: -os linux -ws gtk -arch x86 -product
> org.eclipse.epp.package.jee.product
>
>
> Error
> Mon Jul 19 09:24:25 EDT 2010
> File org.eclipse.datatools.mysql.wrapper/lib/mysql-connector-java
> -5.1.13-bin.jar missing while setting up default driver definitions.
>
> ===================
>
>
> Everything seems fine, just appears that whatever mechanism is loading
> the jarList doesn't understand the plugin-access approach. Using the
> code as-is that you provided above, I clean out the eclipse plugins
> folder of any old ones then I just right-click on the project, export,
> PDE->Deployable plugins and fragments, make sure the wrapper is checked
> (and only one checked), destination directly under the eclipse plugin
> location, finish.
>
>
>
Re: Driver Definition/pre-loading JDBC drivers [message #548368 is a reply to message #548153] Wed, 21 July 2010 15:09 Go to previous messageGo to next message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
This was tested in Eclipse 3.6 (helios).

I wonder if this may help ---

If you are testing the plugin via the PDE Testing feature (launch an eclipse app), it works in that when you go to Windows->Preferences->DataManagement->Connectivity->DriverDefinitions

If you remove any existing connections (for Mysql 5.1 for this test case), then go to 'Add' and select Mysql 5.1, it DOES NOT complain because if you go to the Jar List tab, it replaces the [plugin] definition with your Testing feature directory location directly.

On a live environment, such as creating a plugin.jar and placing that jar in a different Eclipse environment, this does not work as it complains about the above error where it does *not* replace the [plugin] with an associated directory.
Re: Driver Definition/pre-loading JDBC drivers [message #548610 is a reply to message #548368] Thu, 22 July 2010 13:18 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
I was wondering what we were doing differently. Let me play with
exporting the plug-ins to see what happens in my environment and I'll
let you know what happens.

dhartford wrote:
> This was tested in Eclipse 3.6 (helios).
>
> I wonder if this may help ---
>
> If you are testing the plugin via the PDE Testing feature (launch an
> eclipse app), it works in that when you go to
> Windows->Preferences->DataManagement->Connectivity->DriverDefinitions
>
> If you remove any existing connections (for Mysql 5.1 for this test
> case), then go to 'Add' and select Mysql 5.1, it DOES NOT complain
> because if you go to the Jar List tab, it replaces the [plugin]
> definition with your Testing feature directory location directly.
>
> On a live environment, such as creating a plugin.jar and placing that
> jar in a different Eclipse environment, this does not work as it
> complains about the above error where it does *not* replace the [plugin]
> with an associated directory.
Re: Driver Definition/pre-loading JDBC drivers [message #549062 is a reply to message #548610] Fri, 23 July 2010 21:51 Go to previous messageGo to next message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
Ok. Even in a live environment (Helios w/ DTP 1.8) I'm able to export my
plug-in as a runnable jar, drop it into my eclipse plug-ins directory,
and have it show up in the driver list automatically in a fresh workspace.

Even if I delete the driver instance and re-create it, it's finding the
path correctly.

So I'm still unable to reproduce this...

Can you e-mail me your project, exported plug-in, and provide the steps
for me to reproduce?

--Fitz

Brian Fitzpatrick wrote:
> I was wondering what we were doing differently. Let me play with
> exporting the plug-ins to see what happens in my environment and I'll
> let you know what happens.
>
> dhartford wrote:
>> This was tested in Eclipse 3.6 (helios).
>>
>> I wonder if this may help ---
>>
>> If you are testing the plugin via the PDE Testing feature (launch an
>> eclipse app), it works in that when you go to
>> Windows->Preferences->DataManagement->Connectivity->DriverDefinitions
>>
>> If you remove any existing connections (for Mysql 5.1 for this test
>> case), then go to 'Add' and select Mysql 5.1, it DOES NOT complain
>> because if you go to the Jar List tab, it replaces the [plugin]
>> definition with your Testing feature directory location directly.
>>
>> On a live environment, such as creating a plugin.jar and placing that
>> jar in a different Eclipse environment, this does not work as it
>> complains about the above error where it does *not* replace the
>> [plugin] with an associated directory.
Re: Driver Definition/pre-loading JDBC drivers [message #549314 is a reply to message #549062] Mon, 26 July 2010 12:47 Go to previous messageGo to next message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
WRONG:
Old process using eclipse project from: http://drop.io/zgz4xew

Right-Click on project
Export
Plugin Development
Deployable plug-ins and fragments

--default everything, select only 'org.eclipse.datatools.mysql.wrapper (1.0.0)
--Destination:Directory $ECLIPSE_HOME (just underneath the the /plugins/ directory of the eclipse you want to test with).

Using this approach originally to make a plugin jar to send around manually, but this approach/jar does not work.


CORRECT(?):
Use eclipse project from: http://drop.io/zgz4xew

Right-Click on project
Export
Plugin Development
Deployable plug-ins and fragments

--default everything, select only 'org.eclipse.datatools.mysql.wrapper (1.0.0)
--Destination:'Install into host. Repository"

Instead of making a jar, need to make this a 'host location' (assume P2 repository), and then share this location as an update site(?). Restarting the local eclipse with this host now works. Can be verified as under 'Install New Software', a new repository for your local file:/ Exported Repository should be visible.

Sorry for my ignorance in getting this correct and working, is this more the correct approach?


----Question: Not sure how this approach can be shared....

[Updated on: Mon, 26 July 2010 13:48]

Report message to a moderator

Re: Driver Definition/pre-loading JDBC drivers [message #549449 is a reply to message #549314] Mon, 26 July 2010 15:51 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
Weird... I've not tried creating the P2 repository option...

But the only thing I've done differently is export the plug-in as you
did with "WRONG" into some directory, then physically copy that
directory to my Eclipse plugins directory and restart Eclipse.

Honestly if you found a way that works for you, go for it. There are
always multiple ways to get plug-ins installed and the P2 way does seem
to be the more mainstream method these days.

I'm glad you got it working!! :)

--Fitz

dhartford wrote:
>
> WRONG:
> Old process using eclipse project from: http://drop.io/zgz4xew
>
> Right-Click on project
> Export
> Plugin Development
> Deployable plug-ins and fragments
>
> --default everything, select only 'org.eclipse.datatools.mysql.wrapper
> (1.0.0)
> --Destination:Directory $ECLIPSE_HOME (just underneath the the
> /plugins/ directory of the eclipse you want to test with).
>
> Using this approach originally to make a plugin jar to send around
> manually, but this approach/jar does not work.
>
>
> CORRECT(?):
> Use eclipse project from: http://drop.io/zgz4xew
>
> Right-Click on project
> Export
> Plugin Development
> Deployable plug-ins and fragments
>
> --default everything, select only 'org.eclipse.datatools.mysql.wrapper
> (1.0.0)
> --Destination:'Install into host. Repository"
> Instead of making a jar, need to make this a 'host location' (assume P2
> repository), and then share this location as an update site(?).
> Restarting the local eclipse with this host now works. Can be verified
> as under 'Install New Software', a new repository for your local file:/
> Exported Repository should be visible.
>
> Sorry for my ignorance in getting this correct and working, is this more
> the correct approach?
>
>
Re: Driver Definition/pre-loading JDBC drivers [message #597664 is a reply to message #546921] Wed, 14 July 2010 15:25 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
Wait, that's probably not it based on the error you're seeing.

I've not tried this in Eclipse 3.4 in a long time and don't have an
environment, but you may have hit upon a bug. And we're not updating
that version any more.

What plug-in versions are you going against for the
org.eclipse.datatools.connectivity plug-in? Is it 1.6?

--Fitz

Brian Fitzpatrick wrote:
> Did you try flipping the slashes the other way? I hate to say it, but
> that code may be slash stupid. :(
>
> I'm on Linux, so I can't try it right now.
>
> --Fitz
>
> dhartford wrote:
>> Hey all,
>> Carry over from this post: https://community.jboss.org/message/552408
>>
>> Getting into some DTP specific talk, so taking it to this list! :)
>>
>>
>> My intent is to find a way to have 'portable' jdbc driver support in
>> the Eclipse Preferences->DataManagement->Connectivity->Driver
>> Definition section (i.e. not require file-system setup of the jdbc
>> jars). These are for the mysql, ms-sql (whether jtds or sqljdbc.jar,
>> depending on project), postgres, etc.
>>
>> Fitz has helped out greatly to-date in the approach of using an
>> eclipse plugin approach to provide the default jdbc jar and override
>> the template to point to the plugin/jdbc jar location. Now at the
>> point where getting the following errors:
>>
>> for plugin name "com.mycompany.eclipse.jdbc.mysql", exporting as jar
>> plugin to eclipse/plugins location, and using Driver Definition it
>> says in the jarlist "
>> [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java- 5.1.6.jar "
>>
>> ERROR: "File
>> com.mycompany.eclipse.jdbc.mysql/lib/mysql-connector-java-5. 1.6.jar
>> missing while setting up default driver definitions"
>>
>> I've tried making this both as an eclipse plugin, and an OSGI:Equinox
>> plugin, but behaving the same.
>>
>>
>> MANIFEST.MF (abbreviated)
>> ==============================
>> Bundle-SymbolicName: com.mycompany.eclipse.jdbc.mysql;singleton:=true
>> Bundle-Version: 5.1.6
>> Bundle-Vendor: mycompany
>> Bundle-RequiredExecutionEnvironment: J2SE-1.5
>> Import-Package: org.osgi.framework;version="1.3.0"
>> Require-Bundle: org.eclipse.ui.ide,
>> org.eclipse.core.resources
>> Bundle-ClassPath: lib/mysql-connector-java-5.1.6.jar,
>> .
>> ===============================
>>
>>
>> plugin.xml
>> ===========================
>> <?xml version="1.0" encoding="UTF-8"?>
>> <?eclipse version="3.4"?>
>> <plugin>
>> <extension
>> point="org.eclipse.datatools.connectivity.driverExtension">
>> <driverTemplateOverride
>> createDefault="true"
>> jarList="
>> [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java- 5.1.6.jar "
>> priority="1"
>>
>> targetId="org.eclipse.datatools.enablement.mysql.5_1.driverTemplate ">
>> </driverTemplateOverride>
>> </extension>
>> </plugin>
>> ===========================
>>
>> build.properties
>> ===========================
>> source.. = src/
>> output.. = bin/
>> bin.includes = META-INF/,\
>> .,\
>> plugin.xml,\
>> lib/mysql-connector-java-5.1.6.jar
>> ===========================
>>
>>
>> Thanks, it feels sooo close!
>>
>> ((note: there are no extra spaces in the actual implementation, even
>> though it may display as such)).
>>
>>
Re: Driver Definition/pre-loading JDBC drivers [message #597670 is a reply to message #546922] Wed, 14 July 2010 16:00 Go to previous message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
The environment/versions are:

DTP 1.7.0 (v200906***)

Tested both:
*Eclipse 3.6/Win7
*Eclipse 3.5/Fedora12

And I did try slashes both ways in the windows environments, but I only tried the '/' approach in linux.
Re: Driver Definition/pre-loading JDBC drivers [message #597677 is a reply to message #546925] Wed, 14 July 2010 18:01 Go to previous message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
Tested DTP 1.7.2 (200909***) just to be sure, same symptoms.

Unable to test DTP 1.8 at this time (only on eclipse 3.5 currently where I am).
Re: Driver Definition/pre-loading JDBC drivers [message #597682 is a reply to message #597677] Wed, 14 July 2010 23:12 Go to previous message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
Eclipse 3.6/DTP 1.8.0 (201005****) also same symptoms (windows)
Re: Driver Definition/pre-loading JDBC drivers [message #597685 is a reply to message #597682] Thu, 15 July 2010 16:23 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
dhartford wrote:
> Eclipse 3.6/DTP 1.8.0 (201005****) also same symptoms (windows)
Try exporting all the classes in the jar that you're exposing in your
plug-in wrapper. I think that's the only thing I'm seeing different
between what you're doing and what I did.
Re: Driver Definition/pre-loading JDBC drivers [message #597690 is a reply to message #547139] Fri, 16 July 2010 12:38 Go to previous message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
That doesn't seem to work out, as since this approach overrides the template to define where the jar is (by providing a new jarList default value), not sure how that would work out.

What would you use for this line in that scenario?

jarList=" [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java- 5.1.6.jar "
Re: Driver Definition/pre-loading JDBC drivers [message #597696 is a reply to message #597690] Fri, 16 July 2010 14:33 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
If the classes aren't exposed via the manifest when you expose the jar,
it's not actually loading those classes into the Eclipse classloader.

That said, I've created a wrapper that works locally for me on Linux and
stuffed it up here in a zip file: http://drop.io/zgz4xew

See if you can figure out what the diffs are between what you've done
and how I implemented it and maybe we can document this a bit better so
others trying to do the same thing can repeat the process?

--Fitz

dhartford wrote:
> That doesn't seem to work out, as since this approach overrides the
> template to define where the jar is (by providing a new jarList default
> value), not sure how that would work out.
>
> What would you use for this line in that scenario?
>
> jarList=" [com.mycompany.eclipse.jdbc.mysql]/lib/mysql-connector-java-
> 5.1.6.jar "
>
Re: Driver Definition/pre-loading JDBC drivers [message #597704 is a reply to message #547394] Fri, 16 July 2010 17:29 Go to previous message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
I really wish I could say 'yeah', but something is missing --

Fresh Helios-JEE install (v20100617), DTP 1.80(v20100528), on fedora 12 w/openjdk 1.6.0_18 using the file downloaded from above.

"Unable to locate JAR/zip in file system as specified by the driver definition: [org.eclipse.datatools.mysql.wrapper]/lib/mysql-connector-ja va-5.1.13-bin.jar. "

Are you using a trunk or nightly version of DTP?
Re: Driver Definition/pre-loading JDBC drivers [message #597707 is a reply to message #597704] Fri, 16 July 2010 20:00 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
Trunk, but that code hasn't changed at all since probably 1.7

You're not seeing anything worthwhile in the log or console other than
that "Unable to locate JAR/zip in file system as specified by the driver
definition" message?

dhartford wrote:
> I really wish I could say 'yeah', but something is missing --
>
> Fresh Helios-JEE install (v20100617), DTP 1.80(v20100528), on fedora 12
> w/openjdk 1.6.0_18 using the file downloaded from above.
>
> "Unable to locate JAR/zip in file system as specified by the driver
> definition:
> [org.eclipse.datatools.mysql.wrapper]/lib/mysql-connector-ja
> va-5.1.13-bin.jar. "
>
> Are you using a trunk or nightly version of DTP?
Re: Driver Definition/pre-loading JDBC drivers [message #597713 is a reply to message #547446] Mon, 19 July 2010 13:31 Go to previous message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
In the Error Log view:
====================

eclipse.buildId=I20100608-0911
java.version=1.6.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os linux -ws gtk -arch x86 -product org.eclipse.epp.package.jee.product


Error
Mon Jul 19 09:24:25 EDT 2010
File org.eclipse.datatools.mysql.wrapper/lib/mysql-connector-java -5.1.13-bin.jar missing while setting up default driver definitions.

===================


Everything seems fine, just appears that whatever mechanism is loading the jarList doesn't understand the plugin-access approach. Using the code as-is that you provided above, I clean out the eclipse plugins folder of any old ones then I just right-click on the project, export, PDE->Deployable plugins and fragments, make sure the wrapper is checked (and only one checked), destination directly under the eclipse plugin location, finish.
Re: Driver Definition/pre-loading JDBC drivers [message #597732 is a reply to message #547718] Tue, 20 July 2010 20:09 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
Ok, well... I looked back in Bugzilla and we haven't had any issues
reported with this functionality since 1.6, so I'm still not sure what's
going on. I'm able to get this working just fine and BIRT's been using
this functionality for quite a while now with no issues.

I'm out of ideas...

This extension point implementation...

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.datatools.connectivity.driverExtension">
<driverTemplateOverride
createDefault="true"

jarList=" [org.eclipse.datatools.mysql.wrapper]/lib/mysql-connector-ja va-5.1.13-bin.jar "
priority="1"

targetId="org.eclipse.datatools.enablement.mysql.5_1.driverTemplate ">
</driverTemplateOverride>
</extension>
</plugin>

This is my wrapper MANIFEST.MF file:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MySQL JDBC Driver Wrapper
Bundle-SymbolicName: org.eclipse.datatools.mysql.wrapper;singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: lib/mysql-connector-java-5.1.13-bin.jar
Bundle-Vendor: Eclipse.org
Export-Package: com.mysql.jdbc,
com.mysql.jdbc.exceptions,
com.mysql.jdbc.exceptions.jdbc4,
com.mysql.jdbc.integration.c3p0,
com.mysql.jdbc.integration.jboss,
com.mysql.jdbc.interceptors,
com.mysql.jdbc.jdbc2.optional,
com.mysql.jdbc.jmx,
com.mysql.jdbc.log,
com.mysql.jdbc.profiler,
com.mysql.jdbc.util,
org.gjt.mm.mysql
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.datatools.connectivity

And the build.properties:

bin.includes = META-INF/,\
lib/mysql-connector-java-5.1.13-bin.jar,\
plugin.xml

And it all just works just fine for me.

Can you download Eclipse 3.5 or 3.6 and see if you have the same issues?
Maybe it's related to Eclipse 3.4?

--Fitz

dhartford wrote:
> In the Error Log view:
> ====================
>
> eclipse.buildId=I20100608-0911
> java.version=1.6.0_18
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US
> Framework arguments: -product org.eclipse.epp.package.jee.product
> Command-line arguments: -os linux -ws gtk -arch x86 -product
> org.eclipse.epp.package.jee.product
>
>
> Error
> Mon Jul 19 09:24:25 EDT 2010
> File org.eclipse.datatools.mysql.wrapper/lib/mysql-connector-java
> -5.1.13-bin.jar missing while setting up default driver definitions.
>
> ===================
>
>
> Everything seems fine, just appears that whatever mechanism is loading
> the jarList doesn't understand the plugin-access approach. Using the
> code as-is that you provided above, I clean out the eclipse plugins
> folder of any old ones then I just right-click on the project, export,
> PDE->Deployable plugins and fragments, make sure the wrapper is checked
> (and only one checked), destination directly under the eclipse plugin
> location, finish.
>
>
>
Re: Driver Definition/pre-loading JDBC drivers [message #597751 is a reply to message #548153] Wed, 21 July 2010 15:09 Go to previous message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
This was tested in Eclipse 3.6 (helios).

I wonder if this may help ---

If you are testing the plugin via the PDE Testing feature (launch an eclipse app), it works in that when you go to Windows->Preferences->DataManagement->Connectivity->DriverDefinitions

If you remove any existing connections (for Mysql 5.1 for this test case), then go to 'Add' and select Mysql 5.1, it DOES NOT complain because if you go to the Jar List tab, it replaces the [plugin] definition with your Testing feature directory location directly.

On a live environment, such as creating a plugin.jar and placing that jar in a different Eclipse environment, this does not work as it complains about the above error where it does *not* replace the [plugin] with an associated directory.
Re: Driver Definition/pre-loading JDBC drivers [message #597765 is a reply to message #597751] Thu, 22 July 2010 13:18 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
I was wondering what we were doing differently. Let me play with
exporting the plug-ins to see what happens in my environment and I'll
let you know what happens.

dhartford wrote:
> This was tested in Eclipse 3.6 (helios).
>
> I wonder if this may help ---
>
> If you are testing the plugin via the PDE Testing feature (launch an
> eclipse app), it works in that when you go to
> Windows->Preferences->DataManagement->Connectivity->DriverDefinitions
>
> If you remove any existing connections (for Mysql 5.1 for this test
> case), then go to 'Add' and select Mysql 5.1, it DOES NOT complain
> because if you go to the Jar List tab, it replaces the [plugin]
> definition with your Testing feature directory location directly.
>
> On a live environment, such as creating a plugin.jar and placing that
> jar in a different Eclipse environment, this does not work as it
> complains about the above error where it does *not* replace the [plugin]
> with an associated directory.
Re: Driver Definition/pre-loading JDBC drivers [message #597811 is a reply to message #548610] Fri, 23 July 2010 21:51 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
Ok. Even in a live environment (Helios w/ DTP 1.8) I'm able to export my
plug-in as a runnable jar, drop it into my eclipse plug-ins directory,
and have it show up in the driver list automatically in a fresh workspace.

Even if I delete the driver instance and re-create it, it's finding the
path correctly.

So I'm still unable to reproduce this...

Can you e-mail me your project, exported plug-in, and provide the steps
for me to reproduce?

--Fitz

Brian Fitzpatrick wrote:
> I was wondering what we were doing differently. Let me play with
> exporting the plug-ins to see what happens in my environment and I'll
> let you know what happens.
>
> dhartford wrote:
>> This was tested in Eclipse 3.6 (helios).
>>
>> I wonder if this may help ---
>>
>> If you are testing the plugin via the PDE Testing feature (launch an
>> eclipse app), it works in that when you go to
>> Windows->Preferences->DataManagement->Connectivity->DriverDefinitions
>>
>> If you remove any existing connections (for Mysql 5.1 for this test
>> case), then go to 'Add' and select Mysql 5.1, it DOES NOT complain
>> because if you go to the Jar List tab, it replaces the [plugin]
>> definition with your Testing feature directory location directly.
>>
>> On a live environment, such as creating a plugin.jar and placing that
>> jar in a different Eclipse environment, this does not work as it
>> complains about the above error where it does *not* replace the
>> [plugin] with an associated directory.
Re: Driver Definition/pre-loading JDBC drivers [message #597815 is a reply to message #549062] Mon, 26 July 2010 12:47 Go to previous message
dhartford  is currently offline dhartford Friend
Messages: 26
Registered: July 2010
Junior Member
WRONG:
Old process using eclipse project from: http://drop.io/zgz4xew

Right-Click on project
Export
Plugin Development
Deployable plug-ins and fragments

--default everything, select only 'org.eclipse.datatools.mysql.wrapper (1.0.0)
--Destination:Directory $ECLIPSE_HOME (just underneath the the /plugins/ directory of the eclipse you want to test with).

Using this approach originally to make a plugin jar to send around manually, but this approach/jar does not work.


CORRECT(?):
Use eclipse project from: http://drop.io/zgz4xew

Right-Click on project
Export
Plugin Development
Deployable plug-ins and fragments

--default everything, select only 'org.eclipse.datatools.mysql.wrapper (1.0.0)
--Destination:'Install into host. Repository"

Instead of making a jar, need to make this a 'host location' (assume P2 repository), and then share this location as an update site(?). Restarting the local eclipse with this host now works. Can be verified as under 'Install New Software', a new repository for your local file:/ Exported Repository should be visible.

Sorry for my ignorance in getting this correct and working, is this more the correct approach?
Re: Driver Definition/pre-loading JDBC drivers [message #597821 is a reply to message #549314] Mon, 26 July 2010 15:51 Go to previous message
Brian Fitzpatrick is currently offline Brian FitzpatrickFriend
Messages: 495
Registered: July 2009
Senior Member
Weird... I've not tried creating the P2 repository option...

But the only thing I've done differently is export the plug-in as you
did with "WRONG" into some directory, then physically copy that
directory to my Eclipse plugins directory and restart Eclipse.

Honestly if you found a way that works for you, go for it. There are
always multiple ways to get plug-ins installed and the P2 way does seem
to be the more mainstream method these days.

I'm glad you got it working!! :)

--Fitz

dhartford wrote:
>
> WRONG:
> Old process using eclipse project from: http://drop.io/zgz4xew
>
> Right-Click on project
> Export
> Plugin Development
> Deployable plug-ins and fragments
>
> --default everything, select only 'org.eclipse.datatools.mysql.wrapper
> (1.0.0)
> --Destination:Directory $ECLIPSE_HOME (just underneath the the
> /plugins/ directory of the eclipse you want to test with).
>
> Using this approach originally to make a plugin jar to send around
> manually, but this approach/jar does not work.
>
>
> CORRECT(?):
> Use eclipse project from: http://drop.io/zgz4xew
>
> Right-Click on project
> Export
> Plugin Development
> Deployable plug-ins and fragments
>
> --default everything, select only 'org.eclipse.datatools.mysql.wrapper
> (1.0.0)
> --Destination:'Install into host. Repository"
> Instead of making a jar, need to make this a 'host location' (assume P2
> repository), and then share this location as an update site(?).
> Restarting the local eclipse with this host now works. Can be verified
> as under 'Install New Software', a new repository for your local file:/
> Exported Repository should be visible.
>
> Sorry for my ignorance in getting this correct and working, is this more
> the correct approach?
>
>
Previous Topic:Any detailed documenttation about how to use DTP in a RCP application ?
Next Topic:what is this ?
Goto Forum:
  


Current Time: Fri Dec 19 16:40:25 GMT 2014

Powered by FUDForum. Page generated in 0.05142 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software