Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » BuddyPolicy Question
BuddyPolicy Question [message #102660] Thu, 06 December 2007 16:19 Go to next message
Eclipse UserFriend
Originally posted by: ryan.dougherty.infor.com

All -

I'm new to OSGi, and ran into an issue trying to persist data to a database. I'm using commons-dbcp to create a connection pool, which takes a database driver's class name via a property. Given OSGi's classloader architecture, I know this will fail as the dbcp bundle knows nothing about the database driver I'm using (mysql). Reading through the forums - I realized that the easiest solution was to use Eclipse-BuddyPolicy. I modified the dbcp manifest with the following line:

Eclipse-BuddyPolicy: registered

I then modified the mysql bundle with the following line:

Eclipse-RegisterBuddy: commons-dbcp

This didn't work - and given all that I read, I'm confused why it didn't. I've made sure that the bundle-name and bundle-symbolicname are set to commons-dbcp for the dbcp bundle.

Since this didn't work, I tried setting the dbcp's Eclipse-BuddyPolicy to global, which solved the problem. While this works, I'd prefer to get the registered option to work, as I won't be searching all of the extended bundle's classpaths.

My app's running in Equinox 3.3.

Any help would be greatly appreciated.

Thanks,

- Ryan
Re: BuddyPolicy Question [message #102682 is a reply to message #102660] Thu, 06 December 2007 16:56 Go to previous messageGo to next message
Snjezana Peco is currently offline Snjezana PecoFriend
Messages: 789
Registered: July 2009
Senior Member
You can try to add commons-dbcp dependency to the mysql plugin.

Snjeza


ryan dougherty wrote:
> All -
>
> I'm new to OSGi, and ran into an issue trying to persist data to a database. I'm using commons-dbcp to create a connection pool, which takes a database driver's class name via a property. Given OSGi's classloader architecture, I know this will fail as the dbcp bundle knows nothing about the database driver I'm using (mysql). Reading through the forums - I realized that the easiest solution was to use Eclipse-BuddyPolicy. I modified the dbcp manifest with the following line:
>
> Eclipse-BuddyPolicy: registered
>
> I then modified the mysql bundle with the following line:
>
> Eclipse-RegisterBuddy: commons-dbcp
>
> This didn't work - and given all that I read, I'm confused why it didn't. I've made sure that the bundle-name and bundle-symbolicname are set to commons-dbcp for the dbcp bundle.
>
> Since this didn't work, I tried setting the dbcp's Eclipse-BuddyPolicy to global, which solved the problem. While this works, I'd prefer to get the registered option to work, as I won't be searching all of the extended bundle's classpaths.
>
> My app's running in Equinox 3.3.
>
> Any help would be greatly appreciated.
>
> Thanks,
>
> - Ryan
Re: BuddyPolicy Question [message #102696 is a reply to message #102682] Thu, 06 December 2007 17:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ryan.dougherty.infor.com

snjeza,

Are you suggesting that I Import the commons-dbcp package in the mysql bundle? Or is there another way to show dependency?

Thanks,

- Ryan
Re: BuddyPolicy Question [message #102708 is a reply to message #102696] Thu, 06 December 2007 17:54 Go to previous messageGo to next message
Snjezana Peco is currently offline Snjezana PecoFriend
Messages: 789
Registered: July 2009
Senior Member
You would add the commons-dbcp plugin to the Dependencies tab of the
mysql Manifest editor.

Snjeza

ryan dougherty wrote:
> snjeza,
>
> Are you suggesting that I Import the commons-dbcp package in the mysql bundle? Or is there another way to show dependency?
>
> Thanks,
>
> - Ryan
Re: BuddyPolicy Question [message #102721 is a reply to message #102708] Thu, 06 December 2007 20:28 Go to previous message
Eclipse UserFriend
Originally posted by: ryan.dougherty.infor.com

Adding commons-dbcp to the Import-Packages of the mysql bundle worked. Thanks for your help.

- Ryan
Previous Topic:Is this possible with jsp and osgi?
Next Topic:Equinox on Websphere and context updates
Goto Forum:
  


Current Time: Tue Apr 16 16:41:50 GMT 2024

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

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

Back to the top