felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arnaud Quiblier" <aquibl...@gmail.com>
Subject FELIX-26: Improve native library matching algorithm
Date Wed, 16 Aug 2006 11:03:33 GMT
Well, I easyly found where the changes have to occured (including
modifications of parsing header) and I will explain this when I will update
the isuue.
But before to begin, I want to write a (very) small bundle loading a native
And that's the problem ... I just can't !!!

So I write a little class HelloWorldNative with a sole native method
printNative() which call a C method compiled into HelloWorldNative.dll
I test my sample out of Felix, and it works fine.

So I bundle it. My activator create an instance of the HelloWorldNative
This contains a static loading of the native library.
I'm sure the library is loaded, cause when it's not present, the error is
quite explicit.
So the loading is OK, but it seems that's the VM checks all methods and
verifies that's a correct implementation exists in the dll.
And there's my bug ... It can't find the corresponding native method !!!
The tracelog :

DEBUG: WIRE: 4.0 -> org.osgi.framework -> 0
+++ new   <<< new HelloWorldNative() call
+++ loading...   <<< before System.loadLibrary()
DEBUG: R4SearchPolicyCore.findLibrary()...
DEBUG: path: C:\Documents and Settings\Arnaud
Quiblier\.felix\a\bundle4\version0.0\lib\HelloWorldNative.dll   <<< dll's
path is OK
java.lang.UnsatisfiedLinkError: C:\Documents and Settings\Arnaud
Quiblier\.felix\a\bundle4\version0.0\lib\HelloWorldNative.dll: La procédure
spécifiée est introuvable   <<< Sorry it's french ... but this is my problem
=====  trace  =====
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1495)
    at java.lang.Runtime.loadLibrary0(Runtime.java:788)
    at java.lang.System.loadLibrary(System.java:834)
    at HelloWorldNative.<clinit>(HelloWorldNative.java:8)
    at Activator.doWork(Activator.java:26)
    at Activator.start(Activator.java:10)
    at org.apache.felix.framework.Felix._startBundle(Felix.java:1216)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:1149)
    at org.apache.felix.framework.Felix.setFrameworkStartLevel(Felix.java
    at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java
    at java.lang.Thread.run(Thread.java:534)
--- loaded.
--- new

Any idea is welcome ...


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message