ProjectKig / KigPaper

Paper 1.8.8 fork with critical performance tweaks, bug fixes and gameplay improvements.
https://playkig.com
43 stars 11 forks source link

NoClassDefFoundError: org.fusesource.jansi.WindowsAnsiOutputStream #17

Open Smart123s opened 2 years ago

Smart123s commented 2 years ago

I pulled the image ghcr.io/projectkig/kigpaper/kig-paper:ver-1.8.8_j9, then copied server.jar to my Windows machine. Upon starting it, I received the following error:

PS C:\lol> & 'C:\Program Files\Java\jre1.8.0_333\bin\java' -jar .\server.jar
Loading libraries, please wait...
java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.WindowsAnsiOutputStream
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.apache.logging.log4j.core.appender.ConsoleAppender.getOutputStream(ConsoleAppender.java:128)
        at org.apache.logging.log4j.core.appender.ConsoleAppender.getManager(ConsoleAppender.java:104)
        at org.apache.logging.log4j.core.appender.ConsoleAppender.createAppender(ConsoleAppender.java:99)
        at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:53)
        at org.apache.logging.log4j.core.LoggerContext.<init>(LoggerContext.java:63)
        at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:217)
        at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:114)
        at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:81)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:83)
        at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:34)
        at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:387)
        at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:322)
        at net.minecraft.server.v1_8_R3.MinecraftServer.<clinit>(MinecraftServer.java:53)
        at org.bukkit.craftbukkit.Main.main(Main.java:201)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.destroystokyo.paperclip.Paperclip.main(Paperclip.java:177)

The official paper-1.8.8-445.jar works without any issues.

Windows Java version:

PS C:\lol> & 'C:\Program Files\Java\jre1.8.0_333\bin\java' -version
java version "1.8.0_333"
Java(TM) SE Runtime Environment (build 1.8.0_333-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.333-b02, mixed mode)

Running the Paperclip version gave the exact same error.


KigPaper works fine in ArchWSL. Java version:

[user@ArchWSL lol]$ /usr/lib/jvm/java-8-openjdk/bin/java -version
openjdk version "1.8.0_345"
OpenJDK Runtime Environment (build 1.8.0_345-b01)
OpenJDK 64-Bit Server VM (build 25.345-b01, mixed mode)
Smart123s commented 2 years ago

On e1bae31 (build using build container) I got

Loading libraries, please wait...
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.NoClassDefFoundError: Could not initialize class org.fusesource.jansi.internal.Kernel32
        at org.fusesource.jansi.internal.WindowsSupport.getConsoleMode(WindowsSupport.java:50)
        at org.bukkit.craftbukkit.libs.jline.WindowsTerminal.getConsoleMode(WindowsTerminal.java:204)
        at org.bukkit.craftbukkit.libs.jline.WindowsTerminal.init(WindowsTerminal.java:82)
        at org.bukkit.craftbukkit.libs.jline.TerminalFactory.create(TerminalFactory.java:101)
        at org.bukkit.craftbukkit.libs.jline.TerminalFactory.get(TerminalFactory.java:158)
        at org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.<init>(ConsoleReader.java:229)
        at org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.<init>(ConsoleReader.java:221)
        at org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.<init>(ConsoleReader.java:213)
        at net.minecraft.server.v1_8_R3.MinecraftServer.<init>(MinecraftServer.java:141)
        at net.minecraft.server.v1_8_R3.DedicatedServer.<init>(DedicatedServer.java:46)
        at net.minecraft.server.v1_8_R3.MinecraftServer.main(MinecraftServer.java:1009)
        at org.bukkit.craftbukkit.Main.main(Main.java:201)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.destroystokyo.paperclip.Paperclip.main(Paperclip.java:177)
[19:25:32 INFO]: Starting minecraft server version 1.8.8
[19:25:32 INFO]: Loading properties
[19:25:32 INFO]: Default game type: SURVIVAL
[19:25:33 INFO]: This server is running CraftBukkit version git-PaperSpigot-"e1bae31f1" (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT)
[19:25:33 INFO]: Unable to find file banned-players.json, creating it.
[19:25:33 INFO]: Unable to find file banned-ips.json, creating it.
[...]

but at least the server started up on Windows.

Using the -nojline flag as suggested here makes the issue go away.