Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnsatisfiedLinkError with Netty #1203

Closed
guenhter opened this issue Jun 26, 2019 · 3 comments
Closed

UnsatisfiedLinkError with Netty #1203

guenhter opened this issue Jun 26, 2019 · 3 comments
Assignees

Comments

@guenhter
Copy link

@guenhter guenhter commented Jun 26, 2019

Ktor Version

1.2.2

Ktor Engine Used(client or server and name)

val ktorVersion = "1.2.2"
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("io.ktor:ktor-auth:$ktorVersion")
implementation("io.ktor:ktor-websockets:$ktorVersion")

JVM Version, Operating System and Relevant Context

/usr/lib/jvm/jdk-11.0.2/bin/java

Feedback

Starting the Ktor application with Netty gives me the error below.
The program runs without problems. All rest requests are working but the error still is not nice.
I guess it's a more Netty related Problem but I post it here to discuss if e.g. missing dependencies should be included to avoid this error at startup time.

13:30:41.590 [main] DEBUG io.netty.util.internal.NativeLibraryLoader - netty_transport_native_epoll cannot be loaded from java.library.path, now trying export to -Dio.netty.native.workdir: /tmp
java.lang.UnsatisfiedLinkError: no netty_transport_native_epoll in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]
	at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2660)
	at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:829)
	at java.base/java.lang.System.loadLibrary(System.java:1867)
	at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
	at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:349)
	at io.netty.util.internal.NativeLibraryLoader.load(NativeLibraryLoader.java:136)
	at io.netty.channel.epoll.Native.loadNativeLibrary(Native.java:201)
	at io.netty.channel.epoll.Native.<clinit>(Native.java:61)
	at io.netty.channel.epoll.Epoll.<clinit>(Epoll.java:38)
	at io.ktor.server.netty.EventLoopGroupProxy$Companion.create(NettyApplicationEngine.kt:186)
	at io.ktor.server.netty.NettyApplicationEngine.<init>(NettyApplicationEngine.kt:74)
	at io.ktor.server.netty.Netty.create(Embedded.kt:14)
	at io.ktor.server.netty.Netty.create(Embedded.kt:12)
	at io.ktor.server.engine.EmbeddedServerKt.embeddedServer(EmbeddedServer.kt:79)
	at io.ktor.server.engine.EmbeddedServerKt.embeddedServer(EmbeddedServer.kt:67)
	at io.ktor.server.engine.EmbeddedServerKt.embeddedServer(EmbeddedServer.kt:36)
	at io.ktor.server.engine.EmbeddedServerKt.embeddedServer$default(EmbeddedServer.kt:34)
	at com.frauscher.sensor.onyxsimulator.ApplicationKt.runOnyxSimulator(Application.kt:66)
	at com.frauscher.sensor.onyxsimulator.ApplicationKt.main(Application.kt:62)
	at com.frauscher.sensor.onyxsimulator.ApplicationKt.main(Application.kt)
	Suppressed: java.lang.UnsatisfiedLinkError: no netty_transport_native_epoll in java.library.path: [/usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]
		at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2660)
		at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:829)
		at java.base/java.lang.System.loadLibrary(System.java:1867)
		at io.netty.util.internal.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:38)
		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
		at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		at java.base/java.lang.reflect.Method.invoke(Method.java:566)
		at io.netty.util.internal.NativeLibraryLoader$1.run(NativeLibraryLoader.java:369)
		at java.base/java.security.AccessController.doPrivileged(Native Method)
		at io.netty.util.internal.NativeLibraryLoader.loadLibraryByHelper(NativeLibraryLoader.java:361)
		at io.netty.util.internal.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:339)
		... 15 common frames omitted
@cy6erGn0m

This comment has been minimized.

Copy link
Contributor

@cy6erGn0m cy6erGn0m commented Jun 26, 2019

Since 1.2.2 netty engine is trying to initialize native transport is available with fallback to NIO implementation. This is not an error. The problem is that you have wrong logger configuration so you see netty debug log.

@cy6erGn0m

This comment has been minimized.

Copy link
Contributor

@cy6erGn0m cy6erGn0m commented Jun 26, 2019

@cy6erGn0m cy6erGn0m self-assigned this Jun 26, 2019
@guenhter

This comment has been minimized.

Copy link
Author

@guenhter guenhter commented Jun 27, 2019

Oh true. This is only logged on DEBUG level. Appreciate that. I'll turn off DEBUG here. Thx.

@guenhter guenhter closed this Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.