Unable to initialize PlatformDependent0 (Netty 4.1.8.Final)
See original GitHub issueExpected behavior
No errors
Actual behavior
java.lang.NoClassDefFoundError: Could not initialize class io.netty.util.internal.PlatformDependent0 io.netty.common[io.netty.channel.DefaultChannelId] : Could not invoke Process.myPid(); not Android? java.lang.ClassNotFoundException: android/os/Process
Steps to reproduce
On Ubuntu 16: git clone https://github.com/shumy/leffe-wg cd leffe-wg gradle ./run.sh
Minimal yet complete reproducer code (or URL to code)
https://github.com/shumy/leffe-wg
Netty version
4.1.8.Final
JVM version (e.g. java -version
)
Java 8 on Apache Felix OSGi
OS version (e.g. uname -a
)
Linux micael 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
OSGi bundles
0|Active | 0|System Bundle (5.4.0)|5.4.0
1|Active | 1|Guava: Google Core Libraries for Java (18.0.0)|18.0.0
2|Active | 1|Jackson-annotations (2.7.0)|2.7.0
3|Active | 1|Jackson-core (2.7.4)|2.7.4
4|Active | 1|jackson-databind (2.7.4)|2.7.4
5|Active | 1|com.github.shumy.leffe-wg (1.0.0)|1.0.0
6|Active | 1|Netty/Buffer (4.1.8.Final)|4.1.8.Final
7|Active | 1|Netty/Codec (4.1.8.Final)|4.1.8.Final
8|Active | 1|Netty/Codec/DNS (4.1.8.Final)|4.1.8.Final
9|Active | 1|Netty/Codec/HTTP (4.1.8.Final)|4.1.8.Final
10|Active | 1|Netty/Codec/HTTP2 (4.1.8.Final)|4.1.8.Final 11|Active | 1|Netty/Codec/Socks (4.1.8.Final)|4.1.8.Final 12|Active | 1|Netty/Common (4.1.8.Final)|4.1.8.Final 13|Active | 1|Netty/Handler (4.1.8.Final)|4.1.8.Final 14|Active | 1|Netty/Handler/Proxy (4.1.8.Final)|4.1.8.Final 15|Active | 1|Netty/Resolver (4.1.8.Final)|4.1.8.Final 16|Active | 1|Netty/Resolver/DNS (4.1.8.Final)|4.1.8.Final 17|Active | 1|Netty/Transport (4.1.8.Final)|4.1.8.Final 18|Active | 1|Apache Felix Configuration Admin Service (1.8.14)|1.8.14 19|Active | 1|Apache Felix Gogo Command (0.16.0)|0.16.0 20|Active | 1|Apache Felix Gogo Runtime (0.16.2)|0.16.2 21|Active | 1|Apache Felix Gogo Shell (0.12.0)|0.12.0 22|Active | 1|Apache Felix Declarative Services (2.0.8)|2.0.8 23|Active | 1|Xtend Runtime Library (2.11.0.v20170124-1424)|2.11.0.v20170124-1424 24|Active | 1|Xtend Macro Interfaces (2.11.0.v20170124-1424)|2.11.0.v20170124-1424 25|Active | 1|Xbase Runtime Library (2.11.0.v20170124-1424)|2.11.0.v20170124-1424 26|Active | 1|OPS4J Pax Logging - API (1.9.1)|1.9.1 27|Active | 1|Vert.x Core (3.4.1)|3.4.1
Logs and stack trace
Welcome to Apache Felix Gogo
g! Activate leffe-wg… [io.netty.util.internal.logging.InternalLoggerFactory] : Using SLF4J as the default logging framework [io.netty.util.ResourceLeakDetector] : -Dio.netty.leakDetection.level: simple [io.netty.util.ResourceLeakDetector] : -Dio.netty.leakDetection.maxRecords: 4 [io.netty.channel.MultithreadEventLoopGroup] : -Dio.netty.eventLoopThreads: 16 [io.netty.util.internal.PlatformDependent] : -Dio.netty.noUnsafe: false [io.netty.util.internal.PlatformDependent0] : java.nio.Buffer.address: available [io.netty.util.internal.PlatformDependent] : Java version: 8 [io.netty.util.internal.PlatformDependent] : maxDirectMemory: 1832910848 bytes (maybe) [io.netty.util.internal.PlatformDependent] : -Dio.netty.noJavassist: false [io.netty.util.internal.PlatformDependent] : Javassist: unavailable [io.netty.util.internal.PlatformDependent] : You don’t have Javassist in your class path or you don’t have enough permission to load dynamically generated classes. Please check the configuration for better performance. [io.netty.util.internal.PlatformDependent] : -Dio.netty.tmpdir: /tmp (java.io.tmpdir) [io.netty.util.internal.PlatformDependent] : -Dio.netty.bitMode: 64 (sun.arch.data.model) [io.netty.util.internal.PlatformDependent] : -Dio.netty.noPreferDirect: true [io.netty.util.internal.PlatformDependent] : Your platform does not provide complete low-level API for accessing direct buffers reliably. Unless explicitly requested, heap buffer will always be preferred to avoid potential system unstability. [io.netty.util.internal.PlatformDependent] : io.netty.maxDirectMemory: -1 bytes [io.netty.channel.nio.NioEventLoop] : -Dio.netty.noKeySetOptimization: false [io.netty.channel.nio.NioEventLoop] : -Dio.netty.selectorAutoRebuildThreshold: 512 [io.netty.util.internal.PlatformDependent] : org.jctools-core.MpscChunkedArrayQueue: unavailable org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling SLF4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Jakarta Commons Logging API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Log4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Avalon Logger API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling JULI Logger API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Log4J v2 API support. Ignored FQCN: org.apache.logging.log4j.spi.AbstractLogger io.netty.common[io.netty.buffer.PooledByteBufAllocator] : -Dio.netty.allocator.numHeapArenas: 16 io.netty.common[io.netty.buffer.PooledByteBufAllocator] : -Dio.netty.allocator.numDirectArenas: 16 io.netty.common[io.netty.buffer.PooledByteBufAllocator] : -Dio.netty.allocator.pageSize: 8192 io.netty.common[io.netty.buffer.PooledByteBufAllocator] : -Dio.netty.allocator.maxOrder: 11 io.netty.common[io.netty.buffer.PooledByteBufAllocator] : -Dio.netty.allocator.chunkSize: 16777216 io.netty.common[io.netty.buffer.PooledByteBufAllocator] : -Dio.netty.allocator.tinyCacheSize: 512 io.netty.common[io.netty.buffer.PooledByteBufAllocator] : -Dio.netty.allocator.smallCacheSize: 256 io.netty.common[io.netty.buffer.PooledByteBufAllocator] : -Dio.netty.allocator.normalCacheSize: 64 io.netty.common[io.netty.buffer.PooledByteBufAllocator] : -Dio.netty.allocator.maxCachedBufferCapacity: 32768 io.netty.common[io.netty.buffer.PooledByteBufAllocator] : -Dio.netty.allocator.cacheTrimInterval: 8192 io.netty.common[io.netty.buffer.PooledByteBufAllocator] : -Dio.netty.allocator.useCacheForAllThreads: true io.netty.common[io.netty.channel.DefaultChannelId] : Could not invoke ManagementFactory.getRuntimeMXBean().getName(); Android? java.lang.NoClassDefFoundError: Could not initialize class io.netty.util.internal.PlatformDependent0 at io.netty.util.internal.PlatformDependent.getClassLoader(PlatformDependent.java:874) at io.netty.channel.DefaultChannelId.defaultProcessId(DefaultChannelId.java:113) at io.netty.channel.DefaultChannelId.<clinit>(DefaultChannelId.java:78) at io.netty.channel.AbstractChannel.newId(AbstractChannel.java:107) at io.netty.channel.AbstractChannel.<init>(AbstractChannel.java:79) at io.netty.channel.nio.AbstractNioChannel.<init>(AbstractNioChannel.java:84) at io.netty.channel.nio.AbstractNioMessageChannel.<init>(AbstractNioMessageChannel.java:42) at io.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:86) at io.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:72) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at io.netty.channel.ReflectiveChannelFactory.newChannel(ReflectiveChannelFactory.java:38) at io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap.java:321) at io.netty.bootstrap.AbstractBootstrap.doBind(AbstractBootstrap.java:283) at io.netty.bootstrap.AbstractBootstrap.bind(AbstractBootstrap.java:279) at io.vertx.core.net.impl.AsyncResolveConnectHelper.lambda$doBind$2(AsyncResolveConnectHelper.java:78) at io.vertx.core.impl.AddressResolver.lambda$null$0(AddressResolver.java:89) at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:337) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:445) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) at java.lang.Thread.run(Thread.java:745) io.netty.common[io.netty.channel.DefaultChannelId] : Could not invoke Process.myPid(); not Android? java.lang.ClassNotFoundException: android/os/Process at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at io.netty.channel.DefaultChannelId.defaultProcessId(DefaultChannelId.java:126) at io.netty.channel.DefaultChannelId.<clinit>(DefaultChannelId.java:78) at io.netty.channel.AbstractChannel.newId(AbstractChannel.java:107) at io.netty.channel.AbstractChannel.<init>(AbstractChannel.java:79) at io.netty.channel.nio.AbstractNioChannel.<init>(AbstractNioChannel.java:84) at io.netty.channel.nio.AbstractNioMessageChannel.<init>(AbstractNioMessageChannel.java:42) at io.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:86) at io.netty.channel.socket.nio.NioServerSocketChannel.<init>(NioServerSocketChannel.java:72) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at io.netty.channel.ReflectiveChannelFactory.newChannel(ReflectiveChannelFactory.java:38) at io.netty.bootstrap.AbstractBootstrap.initAndRegister(AbstractBootstrap.java:321) at io.netty.bootstrap.AbstractBootstrap.doBind(AbstractBootstrap.java:283) at io.netty.bootstrap.AbstractBootstrap.bind(AbstractBootstrap.java:279) at io.vertx.core.net.impl.AsyncResolveConnectHelper.lambda$doBind$2(AsyncResolveConnectHelper.java:78) at io.vertx.core.impl.AddressResolver.lambda$null$0(AddressResolver.java:89) at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:337) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:445) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) at java.lang.Thread.run(Thread.java:745) io.netty.common[io.netty.util.internal.ThreadLocalRandom] : -Dio.netty.initialSeedUniquifier: 0x153a5d61a8da2108 io.netty.common[io.netty.channel.DefaultChannelId] : Failed to find the current process ID from ‘’; using a random value: -885700473 io.netty.common[io.netty.channel.DefaultChannelId] : -Dio.netty.processId: -885700473 (auto-detected) io.netty.common[io.netty.util.NetUtil] : -Djava.net.preferIPv4Stack: false io.netty.common[io.netty.util.NetUtil] : -Djava.net.preferIPv6Addresses: false io.netty.common[io.netty.util.NetUtil] : Loopback interface: lo (lo, 0:0:0:0:0:0:0:1%lo) io.netty.common[io.netty.util.NetUtil] : /proc/sys/net/core/somaxconn: 128 io.netty.common[io.netty.channel.DefaultChannelId] : -Dio.netty.machineId: 68:5d:43:ff:fe:ee:bb:64 (auto-detected) io.netty.common[io.netty.buffer.ByteBufUtil] : -Dio.netty.allocator.type: pooled io.netty.common[io.netty.buffer.ByteBufUtil] : -Dio.netty.threadLocalDirectBufferSize: 65536 io.netty.common[io.netty.buffer.ByteBufUtil] : -Dio.netty.maxThreadLocalCharBufferSize: 16384 org.ops4j.pax.logging.pax-logging-api[com.github.shumy.leffewg.LeffeVerticle] : Server is now listening on port 9191.
Issue Analytics
- State:
- Created 7 years ago
- Comments:29 (21 by maintainers)
I would prefer to not use
catch Throwable
again if possible.Maybe we should catch
RuntimeException
andLinkageError
.