Question

Recall the Bundle-NativeCode section in MAINFEST.MF:

Bundle-NativeCode: 
  lib/windows/x64/Library1.dll;
  lib/windows/x64/Library2.dll;
  ...
  osname=win32; processor=x86_64

In fact, I have around a hundred of libraries there. What I found out is that depending on the order they are specified, the plugin might fail to load with the following message:

!MESSAGE Missing native code match lib/windows/x64/Library1.dll; lib/windows/x64/Library2.dll; ...

At first, I thought that the reason might be the dependencies between native libraries themselves. In other words, I thought that maybe OSGi expects me to list these native libraries in the order of their dependency, i.e. the most independent ones first. After a few hours of that kind of sorting of a hundred of libraries according to their order, it again failed miserably, what proves that this is not the reason. I have one magical order which was found by chance, when it loads successfully, and it does not resemble any pattern, it is absolutely random order. If I start changing it, then the chance is high that it will fail again. For example, I want to sort them alphabetically, and this will not work.

Could anybody clarfiy what's going on. I've already wasted quite a lot of time on this issue and I'm very confused how on Earth can this happen at all and how to fix it.

Was it helpful?

Solution

The order does not matter. Since you have so many libraries. make sure you use ";" to separate them. Using "," will start a new clause that may cause an error if there are not matching attributes on the clause.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top