Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Troubleshooting OSGi jar wrapping
Troubleshooting OSGi jar wrapping [message #109441] Tue, 13 May 2008 09:39 Go to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
Hi

I have created a new bundle, for wrapping an existing jar file (MySql JDBC
driver).

It should be as easy as updating the MANIFEST.MF file

Here is the contents of this file:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MySql Connector
Bundle-SymbolicName: mysql.connector
Bundle-Version: 5.1.6
Bundle-Vendor: Sun Microsystems
Bundle-ClassPath: .
Export-Package: com.mysql.jdbc

I make plugin name com.mycompany.myplugin depend on the new
mysql.connector plugin. I think this is a better approach than packaging
the mysql.connector.jar inside com.mycompany.myplugin as a regular lib.

Problems:

1- PDE doesn't show mysql.connector as dependencies of
com.mycompany.myplugin
2- Cannot access any class inside mysql.connector from
com.mycompany.myplugin, even though it is inside the exported package
com.mysql.jdbc.

Clearly PDE and Eclipse don't recognize mysql.connector as a plugin, and
doesn't provide me any warning or error.

I have started my RCP app with the -console switch and with the 'ss'
command, mysql.connector plugin isn't listed. :-(

I have already had problems like this from other 3rd party plugins from
Nebula, and had to patch the MANIFEST.MF.

What am I missing?
Any hint will be greatly appreciated.
Re: Troubleshooting OSGi jar wrapping [message #109455 is a reply to message #109441] Tue, 13 May 2008 10:19 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Did you knew that PDE provides a helper to wrap exisiting jars as OSGi
jars? I'm using this feature and package my mysql-jdbc.jar as a OSGi one.

You are searching for:
=> New > Project > Plug-In Development > Plug-In From Existing jars

My wild guess is that PDE is only looking for OSGi-Bundles is your
workspace if the project has a nature of "org.eclipse.pde.PluginNature"
and that's why you are not seeing yours.

Tom

David Perez schrieb:
> Hi
>
> I have created a new bundle, for wrapping an existing jar file (MySql
> JDBC driver).
>
> It should be as easy as updating the MANIFEST.MF file
>
> Here is the contents of this file:
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: MySql Connector
> Bundle-SymbolicName: mysql.connector
> Bundle-Version: 5.1.6
> Bundle-Vendor: Sun Microsystems
> Bundle-ClassPath: .
> Export-Package: com.mysql.jdbc
> I make plugin name com.mycompany.myplugin depend on the new
> mysql.connector plugin. I think this is a better approach than
> packaging the mysql.connector.jar inside com.mycompany.myplugin as a
> regular lib.
>
> Problems:
>
> 1- PDE doesn't show mysql.connector as dependencies of
> com.mycompany.myplugin
> 2- Cannot access any class inside mysql.connector from
> com.mycompany.myplugin, even though it is inside the exported package
> com.mysql.jdbc.
>
> Clearly PDE and Eclipse don't recognize mysql.connector as a plugin, and
> doesn't provide me any warning or error.
>
> I have started my RCP app with the -console switch and with the 'ss'
> command, mysql.connector plugin isn't listed. :-(
>
> I have already had problems like this from other 3rd party plugins from
> Nebula, and had to patch the MANIFEST.MF.
>
> What am I missing?
> Any hint will be greatly appreciated.
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Troubleshooting OSGi jar wrapping [message #109468 is a reply to message #109441] Tue, 13 May 2008 10:19 Go to previous messageGo to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
Solved!

Even though I have made "Window | Preferences | Plug-in development |
Target Platform | Reload", a lot of times, until I haven't restarted
Eclipse, it hasn't detected as valid my plug-in.

David Perez wrote:

> Hi

> I have created a new bundle, for wrapping an existing jar file (MySql JDBC
> driver).

> It should be as easy as updating the MANIFEST.MF file

> Here is the contents of this file:

> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: MySql Connector
> Bundle-SymbolicName: mysql.connector
> Bundle-Version: 5.1.6
> Bundle-Vendor: Sun Microsystems
> Bundle-ClassPath: .
> Export-Package: com.mysql.jdbc

> I make plugin name com.mycompany.myplugin depend on the new
> mysql.connector plugin. I think this is a better approach than packaging
> the mysql.connector.jar inside com.mycompany.myplugin as a regular lib.

> Problems:

> 1- PDE doesn't show mysql.connector as dependencies of
> com.mycompany.myplugin
> 2- Cannot access any class inside mysql.connector from
> com.mycompany.myplugin, even though it is inside the exported package
> com.mysql.jdbc.

> Clearly PDE and Eclipse don't recognize mysql.connector as a plugin, and
> doesn't provide me any warning or error.

> I have started my RCP app with the -console switch and with the 'ss'
> command, mysql.connector plugin isn't listed. :-(

> I have already had problems like this from other 3rd party plugins from
> Nebula, and had to patch the MANIFEST.MF.

> What am I missing?
> Any hint will be greatly appreciated.
Re: Troubleshooting OSGi jar wrapping [message #109507 is a reply to message #109455] Tue, 13 May 2008 10:44 Go to previous messageGo to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
Thanks Tom

I already knew the existence of the wizard, but it's easier to update the
MANIFEST.MF because I don't have another project in my workspace, and
pollute it even more.

The solution is to restart Eclipse, as you can see in my previous post.
There must be some kind of cache in PDE, that doesn't get updated ok.

Tom Schindl wrote:

> Did you knew that PDE provides a helper to wrap exisiting jars as OSGi
> jars? I'm using this feature and package my mysql-jdbc.jar as a OSGi one.

> You are searching for:
> => New > Project > Plug-In Development > Plug-In From Existing jars

> My wild guess is that PDE is only looking for OSGi-Bundles is your
> workspace if the project has a nature of "org.eclipse.pde.PluginNature"
> and that's why you are not seeing yours.

> Tom
Re: Troubleshooting OSGi jar wrapping [message #109572 is a reply to message #109468] Tue, 13 May 2008 14:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zx.us.ibm.com

David Perez wrote:
> Solved!
>
> Even though I have made "Window | Preferences | Plug-in development |
> Target Platform | Reload", a lot of times, until I haven't restarted
> Eclipse, it hasn't detected as valid my plug-in.

How did you solve your problem? I'm trying to understand how PDE is at
fault.

Cheers,

~ Chris
Re: Troubleshooting OSGi jar wrapping [message #109598 is a reply to message #109572] Tue, 13 May 2008 17:44 Go to previous messageGo to next message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
Thanks Chris for your interest,

Simply by restarting Eclipse.
Maybe Eclipse got confused by creating a workspace plugin, and then
deleting it and creating a plugin with the same name in the target
platform, even though I reloaded it.

Chris Aniszczyk wrote:

> David Perez wrote:
>> Solved!
>>
>> Even though I have made "Window | Preferences | Plug-in development |
>> Target Platform | Reload", a lot of times, until I haven't restarted
>> Eclipse, it hasn't detected as valid my plug-in.

> How did you solve your problem? I'm trying to understand how PDE is at
> fault.

> Cheers,

> ~ Chris
Re: Troubleshooting OSGi jar wrapping [message #110052 is a reply to message #109441] Wed, 14 May 2008 10:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ekkehard.gentz-software.de

david,

perhaps another easy way:
download the bundle from
http://www.springsource.com/repository/app/search?query=mysq l

ekke
David Perez wrote:

> Hi

> I have created a new bundle, for wrapping an existing jar file (MySql JDBC
> driver).

> It should be as easy as updating the MANIFEST.MF file
Re: Troubleshooting OSGi jar wrapping [message #110092 is a reply to message #110052] Thu, 15 May 2008 06:47 Go to previous message
David  Pérez is currently offline David PérezFriend
Messages: 228
Registered: July 2009
Senior Member
Thanks ekke, one more useful trick I know about RCP.
Luckily, packaging a .jar as a bundle is quite easy in many cases.

ekke wrote:

> david,

> perhaps another easy way:
> download the bundle from
> http://www.springsource.com/repository/app/search?query=mysq l

> ekke
> David Perez wrote:

>> Hi

>> I have created a new bundle, for wrapping an existing jar file (MySql JDBC
>> driver).

>> It should be as easy as updating the MANIFEST.MF file
Previous Topic:Class loading issues with RCP app
Next Topic:Remote provisioning
Goto Forum:
  


Current Time: Thu Apr 25 18:11:37 GMT 2024

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

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

Back to the top