[jboss-osgi-issues] [JBoss JIRA] (JBOSGI-512) Impossible to load a native library which uses another native library

Laurent Peters (JIRA) jira-events at lists.jboss.org
Wed Jan 25 09:12:48 EST 2012


    [ https://issues.jboss.org/browse/JBOSGI-512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12661871#comment-12661871 ] 

Laurent Peters commented on JBOSGI-512:
---------------------------------------

No sorry, I work only on windows and I have no native library for linux.
                
> Impossible to load a native library which uses another native library
> ---------------------------------------------------------------------
>
>                 Key: JBOSGI-512
>                 URL: https://issues.jboss.org/browse/JBOSGI-512
>             Project: JBoss OSGi
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Core Framework
>    Affects Versions: Core Framework 1.0.0
>         Environment: Windows XP, JBOSS AS7
>            Reporter: Laurent Peters
>            Assignee: Thomas Diesler
>             Fix For: JBossOSGi 1.0.1
>
>
> A native library "b.dll" depends on the library "a.dll". The native libraries must be loaded by  the bundle which contains them. They are both declared in the manifest using Bundle-NativeCode.
> In the activator class, "a.dll" is first loaded using System.loadLibrary().
> When "b.dll" is loaded using System.loadLibrary(), a java.lang.UnsatisfiedLinkError is issued: "Can't find dependent libraries".
> This problem is caused by the following behavior:
> When the native library "a.dll" is loaded, it is first extracted from the bundle into the bundle storage (osgi-store/bundle-XXX) and renamed to a-<date>-<time>.dll, then it is loaded. The name of the library that is loaded is therefore no more "a.dll"
> When the native library "b.dll" is loaded, the system checks if the library "a.dll" is already loaded. It does not detect that the library "a.dll" is loaded and tries to load it again. It issues an exception since it does not find it.
> The problem is in org.jboss.osgi.framework.internal.NativeCodePlugin.BundleNativeLibraryProvider.getUniqueLibraryFile(UserBundleState, String)
> This function should move the native library, without renaming it. Eventually in a folder containing the time stamp.
> Note that the same bundle can be loaded without any problem in Felix, Equinox or Knopflerfish.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-osgi-issues mailing list