Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » DLL hell with different bundles in Eclipse Equinox(How to share a needed DLL between different bundles?)
DLL hell with different bundles in Eclipse Equinox [message #558476] Mon, 13 September 2010 08:04 Go to next message
Bjoern Berg is currently offline Bjoern BergFriend
Messages: 47
Registered: November 2009
Location: Essen
Member
Hello,

I have a question about sharing a needed DLL for a JDBC2-driver between two different bundles that need access to the driver.

The scenario: In my RCP application I integrated the BIRT Runtime environment to execute pre-defined reports in the application. That works perfect, when the appropriate drivers for the database (Oracle driver) are stored to " org.eclipse.birt.report.data.oda.jdbc_2.5.2.v20100205\driver s ". Then I have another bundle that needs access to the database and the same Oracle driver. The problem is, the DLL needed by the JDBC driver is loaded by another Classloader and I get an Unsatisfied Link Exception which is correct so far.

I tried to load the DLL by the VMs Classloader adding it at startup time with -Djava.library.path, but that does not work.

So, what is the best practice to share a driver between different bundles? How did you do that?
Re: DLL hell with different bundles in Eclipse Equinox [message #558647 is a reply to message #558476] Mon, 13 September 2010 18:51 Go to previous messageGo to next message
Gunnar Wagenknecht is currently offline Gunnar WagenknechtFriend
Messages: 486
Registered: July 2009
Location: San Francisco ✈ Germany
Senior Member

Am 13.09.2010 10:04, schrieb Bjoern Berg:
> So, what is the best practice to share a driver between different bundles? How did you do that?

I think you should open a bug report against the BIRT bundle. It
shouldn't require to place the driver into some directory inside the
bundle. Instead, it should use an OSGi service.

New in OSGi 4.2 Enterprise Release is a DataSourceFactory.
http://www.osgi.org/javadoc/r4v42/org/osgi/service/jdbc/Data SourceFactory.html

That is one way (developed by the Enterprise Expert Group) to share a
driver with many bundles.

-Gunnar

--
Gunnar Wagenknecht
gunnar@wagenknecht.org
http://wagenknecht.org/
icon14.gif  Re: DLL hell with different bundles in Eclipse Equinox [message #558813 is a reply to message #558647] Tue, 14 September 2010 14:15 Go to previous message
Bjoern Berg is currently offline Bjoern BergFriend
Messages: 47
Registered: November 2009
Location: Essen
Member
Gunnar Wagenknecht wrote on Mon, 13 September 2010 20:51

New in OSGi 4.2 Enterprise Release is a DataSourceFactory.
http://www.osgi.org/javadoc/r4v42/org/osgi/service/jdbc/Data SourceFactory.html

That is one way (developed by the Enterprise Expert Group) to share a
driver with many bundles.



Thank you for the link. I found a similar solution which can be used very easily with BIRT. I propagate the connection with JNDI URL which can be set in BIRT while creating a new data source for a report.
Previous Topic:Software updates in p2 product - giving up
Next Topic:setting osgi.user.area with a prefix
Goto Forum:
  


Current Time: Tue Apr 16 07:51:09 GMT 2024

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

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

Back to the top