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

Thomas Diesler (JIRA) jira-events at lists.jboss.org
Wed Jan 25 09:47:48 EST 2012


     [ https://issues.jboss.org/browse/JBOSGI-512?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Diesler resolved JBOSGI-512.
-----------------------------------

    Resolution: Done


Could you try this: https://github.com/tdiesler/jbosgi-framework/tree/jbosgi512

I can't quite remember why I introduced the timestamp in the first place. The code above copies the libpath unmodified.

Please reopen if it doesn't work
                
> 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