Java regression and Undertow

In the most recent updates of Java 8 u333 and 11.0.15, there was a regression introduced that affects the XNIO libraries that power Undertow, which CommandBox uses. This issue appears to only affect Windows. If you are getting any of the error messages here, the TL; DR; is simply to update to CommandBox 5.5.1, where we have a workaround already in place.

The original java regression is ticketed here: https://bugs.openjdk.java.net/browse/JDK-8285445
Which broke XNIO as ticketed here: [XNIO-404] Channels cannot open file "NUL:" on Windows - Red Hat Issue Tracker
Which broke Undertow as ticketed here: [UNDERTOW-2073] JDK 8 / 11 updates breaking Undertow - Red Hat Issue Tracker

The affected Java versions are 8u333 and 11.0.15. If you are hitting this bug, you’ll see one or more of these errors in your console and your browser will likely display a connection failure.

java.lang.NoClassDefFoundError: Could not initialize class org.xnio.channels.Channels
java.lang.NoClassDefFoundError: Could not initialize class org.xnio.conduits.Conduits The specific sequence of files included or processed is: ...
java.io.IOError: java.io.FileNotFoundException: Invalid file path
        at org.xnio.channels.Channels$4.run(Channels.java:1103)
        at org.xnio.channels.Channels$4.run(Channels.java:1093)

If you’re not in a position to upgrade CommandBox, you can manually set your Java version to a previous update. Ex:

server set jvm.javaVersion=openjdk8_jdk8u312-b07

Or you can continue with the latest version of java and add this JVM arg:

server set jvm.args=" -Djdk.io.File.enableADS=true"

However, none of that is necessary if you can just update to CommandBox 5.5 where we’re adding that JVM for you by default until Undertow releases their fix.