I reduce the problem: the jni method is invocated when I run main as java application and fails when I run it within plugin.
External plugin has one native and one regular method. Regular method always succeed. Native library is also succeed to load - I get "-I- Success to load". The interface of native library is ok - I checked with javah.
package bbb;
public class aaa {
public final static native long someMethod(String jarg1);
public static void otherMethod() {
System.out.println("Jar containing bbb.aaa.otherMethod() is loaded ok");
}
};
The class calling them:
public class RTL {
static {
System.loadLibrary("kuku");
System.out.println("-I- Success to load native library");
}
public static void buildDesign() {
aaa.otherMethod(); // call regular method - ok
aaa.someMethod(); // call native method - fails
}
public static void main(String argv[]) {
aaa.otherMethod(); // call regular method - ok
aaa.someMethod(); // call native method - ok!!!
}
Any ideas will be appreciated!