Heath123/pakkit

Error when trying to start Bedrock ProxyPass with Java 17

Phoenix616 opened this issue · 0 comments

When trying to start the Bedrock proxy (with GitHub build 98) it will cause errors if the default installed Java version is 17 (8 works)

Shows the following error:

ProxyPass output: WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
ProxyPass output: [12:28:30 DEBUG]: Using SLF4J as the default logging framework
ProxyPass output: [--start-from-args, 0.0.0.0, 19142, 127.0.0.1, 19132, 1, true, true, pakkit, pakkitProxyPoweredByProxyPass, true, 50079]12
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.leakDetection.level: simple
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.leakDetection.targetRecords: 4
ProxyPass output: ProxyPass - Websocket started on port: 50079
ProxyPass output: [12:28:31 INFO ]: Loading server...
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.eventLoopThreads: 32
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.noKeySetOptimization: false
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.selectorAutoRebuildThreshold: 512
ProxyPass output: [12:28:31 DEBUG]: Platform: Windows
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.noUnsafe: false
ProxyPass output: [12:28:31 DEBUG]: Java version: 17
ProxyPass output: [12:28:31 DEBUG]: sun.misc.Unsafe.theUnsafe: available
ProxyPass output: [12:28:31 DEBUG]: sun.misc.Unsafe.copyMemory: available
ProxyPass output: [12:28:31 DEBUG]: java.nio.Buffer.address: available
ProxyPass output: [12:28:31 DEBUG]: direct buffer constructor: unavailable
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled
        at io.netty.util.internal.ReflectionUtil.trySetAccessible(ReflectionUtil.java:31) ~[proxypass-pakkit.jar:?]
        at io.netty.util.internal.PlatformDependent0$4.run(PlatformDependent0.java:225) ~[proxypass-pakkit.jar:?]
        at java.security.AccessController.doPrivileged(AccessController.java:318) ~[?:?]
        at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:219) ~[proxypass-pakkit.jar:?]
        at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:273) ~[proxypass-pakkit.jar:?]
        at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:92) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoop.newTaskQueue0(NioEventLoop.java:285) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoop.newTaskQueue(NioEventLoop.java:156) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:138) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:138) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:37) ~[proxypass-pakkit.jar:?]
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84) ~[proxypass-pakkit.jar:?]
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58) ~[proxypass-pakkit.jar:?]
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:47) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:59) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:78) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:73) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:60) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.network.util.EventLoops$ChannelType.lambda$static$2(EventLoops.java:58) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.network.util.EventLoops.<clinit>(EventLoops.java:36) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.protocol.bedrock.BedrockServer.<init>(BedrockServer.java:30) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.protocol.bedrock.BedrockServer.<init>(BedrockServer.java:26) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.proxypass.ProxyPass.actualBoot(ProxyPass.java:378) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.proxypass.ProxyPass.bootFromArgs(ProxyPass.java:338) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.proxypass.ProxyPass.startFromArgs(ProxyPass.java:304) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.proxypass.ProxyPass.main(ProxyPass.java:286) ~[proxypass-pakkit.jar:?]
ProxyPass output: [12:28:31 DEBUG]: java.nio.Bits.unaligned: available, true
ProxyPass output: [12:28:31 DEBUG]: jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable
java.lang.IllegalAccessException: class io.netty.util.internal.PlatformDependent0$6 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @5ae9a829
        at jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:392) ~[?:?]
        at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:674) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:560) ~[?:?]
        at io.netty.util.internal.PlatformDependent0$6.run(PlatformDependent0.java:335) ~[proxypass-pakkit.jar:?]
        at java.security.AccessController.doPrivileged(AccessController.java:318) ~[?:?]
        at io.netty.util.internal.PlatformDependent0.<clinit>(PlatformDependent0.java:326) ~[proxypass-pakkit.jar:?]
        at io.netty.util.internal.PlatformDependent.isAndroid(PlatformDependent.java:273) ~[proxypass-pakkit.jar:?]
        at io.netty.util.internal.PlatformDependent.<clinit>(PlatformDependent.java:92) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoop.newTaskQueue0(NioEventLoop.java:285) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoop.newTaskQueue(NioEventLoop.java:156) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:138) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:138) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:37) ~[proxypass-pakkit.jar:?]
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84) ~[proxypass-pakkit.jar:?]
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58) ~[proxypass-pakkit.jar:?]
        at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:47) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:59) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:78) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:73) ~[proxypass-pakkit.jar:?]
        at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:60) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.network.util.EventLoops$ChannelType.lambda$static$2(EventLoops.java:58) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.network.util.EventLoops.<clinit>(EventLoops.java:36) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.protocol.bedrock.BedrockServer.<init>(BedrockServer.java:30) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.protocol.bedrock.BedrockServer.<init>(BedrockServer.java:26) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.proxypass.ProxyPass.actualBoot(ProxyPass.java:378) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.proxypass.ProxyPass.bootFromArgs(ProxyPass.java:338) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.proxypass.ProxyPass.startFromArgs(ProxyPass.java:304) ~[proxypass-pakkit.jar:?]
        at com.nukkitx.proxypass.ProxyPass.main(ProxyPass.java:286) ~[proxypass-pakkit.jar:?]
ProxyPass output: [12:28:31 DEBUG]: java.nio.DirectByteBuffer.<init>(long, int): unavailable
ProxyPass output: [12:28:31 DEBUG]: sun.misc.Unsafe: available
ProxyPass output: [12:28:31 DEBUG]: maxDirectMemory: 8573157376 bytes (maybe)
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.tmpdir: E:\TEMP (java.io.tmpdir)
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.bitMode: 64 (sun.arch.data.model)
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.maxDirectMemory: -1 bytes
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.uninitializedArrayAllocationThreshold: -1
ProxyPass output: [12:28:31 DEBUG]: java.nio.ByteBuffer.cleaner(): available
ProxyPass output: [12:28:31 DEBUG]: -Dio.netty.noPreferDirect: false
ProxyPass output: [12:28:31 DEBUG]: org.jctools-core.MpscChunkedArrayQueue: available

A possible solution if compatibility for Java 17 isn't possible yet would be to include the correct JRE inside the zip/exe file. (Which is the suggested approach for any Java application anyways)