Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to load the library 'netty_transport_native_kqueue_x86_64', trying other loading mechanism

Tags:

java

netty

I am trying to use netty with native Kqueue Sockets in my Macbook with Mac OS Sierra. I followed the netty native transport guide

I still see this error in the logs:

       52 [main] DEBUG io.netty.util.internal.NativeLibraryLoader  - Unable to load the library 'netty_transport_native_kqueue_x86_64', trying other loading mechanism.
    java.lang.UnsatisfiedLinkError: no netty_transport_native_kqueue_x86_64 in java.library.path
    	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
    	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    	at java.lang.System.loadLibrary(System.java:1122)
    	at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

and then:

55 [main] DEBUG io.netty.util.internal.NativeLibraryLoader  - netty_transport_native_kqueue_x86_64 cannot be loaded from java.libary.path, now trying export to -Dio.netty.native.workdir: /var/folders/95/w43w134s6lg14g8584qpwcmh0000gn/T
java.lang.UnsatisfiedLinkError: no netty_transport_native_kqueue_x86_64 in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
	at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:243)
	at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:124)

I am using maven and this is my pom:

<dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-kqueue</artifactId>
            <version>4.1.19.Final</version>
            <classifier>${os.detected.name}-${os.detected.arch}</classifier>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-all</artifactId>
            <version>4.1.9.Final</version>
        </dependency>
....

  <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>1.5.0.Final</version>
            </extension>
        </extensions>

This is what intellij lists as imported libs: libnetty_transport_native_kqueue_x86_64.jnilib

like image 521
Daniel Paulus Avatar asked Jan 29 '23 21:01

Daniel Paulus


1 Answers

Note these are just debug messages as it tries different loading-strategies. You can check if it was able to load the native code by using KQueue.isAvailable() after initialization is done.

like image 132
Norman Maurer Avatar answered Feb 08 '23 15:02

Norman Maurer