Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Bundle-NativeCode problem
Bundle-NativeCode problem [message #105646] Fri, 29 February 2008 13:31 Go to next message
Dmitry Hazin is currently offline Dmitry HazinFriend
Messages: 6
Registered: July 2009
Junior Member
Hi,

I created the bundle for Berkeley DB XML that uses some native
libraries. Native libraries are put into fragment-bundle with the
following Bundle-NativeCode directive:
Bundle-NativeCode: msvcr71.dll ; msvcp71.dll ; libdb45.dll ;
libdb_java45.dll ; xerces-c_2_7.dll ; xqilla10.dll ; libdbxml23.dll ;
libdbxml_java23.dll ;
osname = win32 ;
processor = x86

I've analyzed the dlls dependencies so they are listed in the right
order left to right as described in 3.9.1 Native Code Algorithm section
of the OSGi specification.
The versions of equinox bundles are
org.eclipse.equinox.common_3.3.0.v20070426.jar and
org.eclipse.osgi_3.3.1.R33x_v20070828.jar

The problem is that if I start my example bundle with the above
configuration (either from Eclipse or console) I get the "libdb45 not
found" error. But if I explicitly load dlls by System.loadLibrary() call
in the Activator they are loaded correctly and my example bundle works.
Hence it seems that equinox doesn't follow the order of the dlls from
Bundle-NativeCode directive when loading the libraries.
Am I missing something here or should I always explicitly call
System.loadLibrary() for my bundle?

Thanks,
Dmitry
Re: Bundle-NativeCode problem [message #105836 is a reply to message #105646] Tue, 04 March 2008 07:17 Go to previous message
Danail Nachev is currently offline Danail NachevFriend
Messages: 110
Registered: July 2009
Senior Member
Hi,

The Bundle-NativeCode doesn't load the libraries. It is used to describe
the included native libraries in the bundle. The equinox will use this
information to select the appropriate library for the OS/Arch and
extract it and make it available for your System.loadLibrary() call. It
won't call loadLibrary() for you. Your bundle needs to take care of this
call (either in the Activator or in some static initializer).

Danail

dhazin wrote:
> Hi,
>
> I created the bundle for Berkeley DB XML that uses some native
> libraries. Native libraries are put into fragment-bundle with the
> following Bundle-NativeCode directive:
> Bundle-NativeCode: msvcr71.dll ; msvcp71.dll ; libdb45.dll ;
> libdb_java45.dll ; xerces-c_2_7.dll ; xqilla10.dll ; libdbxml23.dll ;
> libdbxml_java23.dll ;
> osname = win32 ;
> processor = x86
>
> I've analyzed the dlls dependencies so they are listed in the right
> order left to right as described in 3.9.1 Native Code Algorithm section
> of the OSGi specification.
> The versions of equinox bundles are
> org.eclipse.equinox.common_3.3.0.v20070426.jar and
> org.eclipse.osgi_3.3.1.R33x_v20070828.jar
>
> The problem is that if I start my example bundle with the above
> configuration (either from Eclipse or console) I get the "libdb45 not
> found" error. But if I explicitly load dlls by System.loadLibrary() call
> in the Activator they are loaded correctly and my example bundle works.
> Hence it seems that equinox doesn't follow the order of the dlls from
> Bundle-NativeCode directive when loading the libraries.
> Am I missing something here or should I always explicitly call
> System.loadLibrary() for my bundle?
>
> Thanks,
> Dmitry
Previous Topic:Rapdemo in Tomcat won't start
Next Topic:reuse of pre-compiled jsp's
Goto Forum:
  


Current Time: Sun Oct 24 20:12:12 GMT 2021

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

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

Back to the top