BuddyPolicy Question [message #102660] |
Thu, 06 December 2007 16:19 |
Eclipse User |
|
|
|
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 |
Snjezana Peco 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 |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03441 seconds