Delostik opened a new issue #7995:
URL: https://github.com/apache/pulsar/issues/7995
**Describe the bug**
I use brpc(a rpc framework) with netty 4.1.16.Final to create epoll event
loop, but see following error:
```
Exception in thread "Thread-bat2-test" java.lang.UnsatisfiedLinkError:
failed to load the required native library
at io.netty.channel.epoll.Epoll.ensureAvailability(Epoll.java:81)
at
io.netty.channel.epoll.EpollEventLoop.<clinit>(EpollEventLoop.java:55)
at
io.netty.channel.epoll.EpollEventLoopGroup.newChild(EpollEventLoopGroup.java:134)
at
io.netty.channel.epoll.EpollEventLoopGroup.newChild(EpollEventLoopGroup.java:35)
at
io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
at
io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58)
at
io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:47)
at
io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:59)
at
io.netty.channel.epoll.EpollEventLoopGroup.<init>(EpollEventLoopGroup.java:104)
at
io.netty.channel.epoll.EpollEventLoopGroup.<init>(EpollEventLoopGroup.java:91)
at
io.netty.channel.epoll.EpollEventLoopGroup.<init>(EpollEventLoopGroup.java:68)
at
com.baidu.brpc.thread.BrpcThreadPoolManager.createClientIoThreadPool(BrpcThreadPoolManager.java:75)
at
com.baidu.brpc.thread.BrpcThreadPoolManager.getOrCreateClientIoThreadPool(BrpcThreadPoolManager.java:50)
at
com.baidu.brpc.client.channel.BootstrapManager.createBooStrap(BootstrapManager.java:94)
at
com.baidu.brpc.client.channel.BootstrapManager.getOrCreateBootstrap(BootstrapManager.java:48)
at
com.baidu.brpc.client.channel.AbstractBrpcChannel.<init>(AbstractBrpcChannel.java:40)
at
com.baidu.brpc.client.channel.BrpcSingleChannel.<init>(BrpcSingleChannel.java:83)
at
com.baidu.brpc.client.channel.BrpcChannelFactory.createChannel(BrpcChannelFactory.java:12)
at
com.baidu.brpc.client.CommunicationClient.<init>(CommunicationClient.java:67)
at
com.baidu.brpc.client.InterceptCommunicationClient.<init>(InterceptCommunicationClient.java:22)
at
com.baidu.brpc.naming.NamingServiceProcessor.addInstance(NamingServiceProcessor.java:112)
at
com.baidu.brpc.naming.NamingServiceProcessor.addInstances(NamingServiceProcessor.java:102)
at
com.baidu.brpc.naming.NamingServiceProcessor.<init>(NamingServiceProcessor.java:59)
at
com.baidu.brpc.client.RpcClient.setServiceInterface(RpcClient.java:155)
at com.baidu.brpc.client.BrpcProxy.getProxy(BrpcProxy.java:130)
at com.baidu.brpc.client.BrpcProxy.getProxy(BrpcProxy.java:126)
at com.test-project.ProxyClient.<init>(ProxyClient.java:49)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
io.netty.channel.epoll.Native
at io.netty.channel.epoll.Epoll.<clinit>(Epoll.java:33)
... 34 more
```
It seems that the shaded package was loaded but cannot load native library.
And I unpackage the jar
```
root@mytestenv:~# ldd --version
ldd (Ubuntu GLIBC 2.23-0ubuntu11) 2.23
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
root@mytestenv:~# ldd
./META-INF/native/libnetty_transport_native_epoll_x86_64.so
linux-vdso.so.1 => (0x00007ffddd186000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7b59749000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7b5937f000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f7b59162000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7b59b5f000)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]