OSGI Bundle-NativeCode give error “No match found for native code”

故事扮演 提交于 2019-12-08 08:14:21

问题


I'm developing an OSGI bundle which uses the native library librxtxSerial. The first time, I had to deploy this bundle on a raspberry, so I've did something like that:

I put the native library under: lib/librxtxSerial.so (NB: INSIDE the java project).

Then, in the MANIFEST I've wrote:

Bundle-NativeCode: lib/librxtxSerial.so

Everything works fine!!!

Now, the problem is that I've to deploy the same bundle on other embedded device which uses a different processor architecture (x86 instead ARM).

So, I've downloaded the x86 build for the librxtxSerial library and I modified my folder structure in something like that:

 - lib
   - x86
     - librxtxSerial.so
   - arm
     - librxtxSerial.so

And I've modified my MANIFEST in this way:

Bundle-NativeCode: lib/x86/librxtxSerial;processor=x86, lib/arm/librxtxSerial;processor=ARM_le

Trying to compile (through maven tycho plugin) I always get the same error:

No match found for native code: lib/x86/librxtxSerial; processor=x86, lib/arm/librxtxSerial; processor=ARM_le

How can I solve this?


回答1:


Ok, i've solved. Not sure why but in order to solve this issue is enough to add '*' at the end of the header, so:

Bundle-NativeCode: lib/x86/librxtxSerial;processor=x86, lib/arm/librxtxSerial;processor=ARM_le, *

it now works.



来源:https://stackoverflow.com/questions/32625924/osgi-bundle-nativecode-give-error-no-match-found-for-native-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!