On Wed, Jul 10, 2019 at 9:10 PM Igal Sapir <[email protected]> wrote:
> Rémy,
>
> At the risk of pointing out the obvious as I'm sure that you are much
> more familiar with this than I am:
>
> On 7/10/2019 11:42 AM, Rémy Maucherat wrote:
> > Hi,
> >
> > I'm a bit stumped there, as I'm trying to get native to work in that
> > rather special environment.
> >
> > JNI_OnLoad fails with:
> > WARNING: The APR based Apache Tomcat Native library failed to load.
> > The error reported was [Unsupported JNI version 0xffffffff, required
> > by bin/libtcnative-1.so.0.2.23]
> > java.lang.UnsatisfiedLinkError: Unsupported JNI version 0xffffffff,
> > required by bin/libtcnative-1.so.0.2.23
> > at
> >
> com.oracle.svm.jni.JNILibraryInitializer.initialize(JNILibraryLoadFeature.java:87)
> > at
> >
> com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibrary0(NativeLibrarySupport.java:153)
> > at
> >
> com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibrary(NativeLibrarySupport.java:98)
> > at
> > java.lang.ClassLoader.loadLibrary(Target_java_lang_ClassLoader.java:126)
> > at java.lang.Runtime.load0(Runtime.java:809)
> > at java.lang.Runtime.load(Runtime.java:241)
> > at java.lang.System.load(System.java:366)
> > at org.apache.tomcat.jni.Library.<init>(Library.java:42)
> >
> > Although this looks weird, this is actually returning -1 and it's
> > normal when it fails [it's a bad error message]. Most likely this
> > doesn't work:
> > if ((*vm)->GetEnv(vm, &ppe, JNI_VERSION_1_4)) {
> > return JNI_ERR;
> > }
> >
> > Any ideas ?
>
> From [1]: "JNI_OnLoad must return the JNI version needed by the native
> library". -1 is translated into 0xffffffff, which is the invalid result.
>
> From the snippet you posted I'm guessing that the returned value is
> supposed to be JNI_VERSION_1_4 or greater.
>
> Do you know what that snippet is trying to check?
>
https://docs.oracle.com/javase/9/docs/specs/jni/invocation.html#getenv
So it seems to fail and return JNI_ERR (-1). I think it's failing there
because there's no other error message.
Rémy
>
> Igal
>
> [1]
>
> https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/invocation.html#JNJI_OnLoad
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>