EAP 7 is unavailable after updating to java 1.8 u331 and java 11.0.15 due to org.xnio.channels.Channels NoClassDefFoundError

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7.x
    • Windows
      • Oracle Java 11.0.15
      • Oracle Java 1.8.0_331
      • Red Hat OpenJDK 11.0.15 (java-11-openjdk-11.0.15.9-3.windows)
      • Red Hat OpenJDK 1.8.0_332 (java-1.8.0-openjdk-1.8.0.332-1.b09.redhat.windows)

Issue

  • After updating to JDK 1.8 update 331 on JBoss EAP 7.1.6 on Windows, the Admin Console is no longer shown. Applications are also not accessible.
  • After we installed Oracle JDK 1.8 update 331 or JDK 11.0.15, we are unable to get into Admin Console.
  • When using JDK 11.0.15 a FileNotFoundException is thrown when a user is logging into the management console. The management console is no longer available
INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin-Konsole horcht an http://127.0.0.1:9990
ERROR [io.undertow.request] (External Management Request Threads -- 1) UT005071: Undertow request failed HttpServerExchange{ GET /management}: java.io.IOError: java.io.FileNotFoundException: Invalid file path
        at org.jboss.xnio@3.8.6.Final-redhat-00001//org.xnio.channels.Channels$4.run(Channels.java:1103)
        at org.jboss.xnio@3.8.6.Final-redhat-00001//org.xnio.channels.Channels$4.run(Channels.java:1093)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at org.jboss.xnio@3.8.6.Final-redhat-00001//org.xnio.channels.Channels.<clinit>(Channels.java:1093)
        at io.undertow.core@2.2.16.Final-redhat-00001//io.undertow.io.UndertowOutputStream.write(UndertowOutputStream.java:232)
        at io.undertow.core@2.2.16.Final-redhat-00001//io.undertow.io.BlockingSenderImpl.writeBuffer(BlockingSenderImpl.java:245)
.. ..
.. ..
Caused by: java.io.FileNotFoundException: Invalid file path
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:231)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:126)
        at org.jboss.xnio@3.8.6.Final-redhat-00001//org.xnio.channels.Channels$4.run(Channels.java:1098)
        ... 29 more
  • EAP boots up with errors after updating to Java 1.8 u133
2022-04-20 10:41:17,188 ERROR [org.xnio.listener] (management I/O-2) XNIO001007: A channel event listener threw an exception: java.io.IOError: java.io.FileNotFoundException: Invalid file path
	at org.xnio.channels.Channels$4.run(Channels.java:998)
	at org.xnio.channels.Channels$4.run(Channels.java:988)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.xnio.channels.Channels.<clinit>(Channels.java:988)
	at org.jboss.remoting3.remote.ServerConnectionOpenListener$Initial.initialiseCapabilities(ServerConnectionOpenListener.java:158)
	at org.jboss.remoting3.remote.ServerConnectionOpenListener$Initial.sendCapabilities(ServerConnectionOpenListener.java:415)
	at org.jboss.remoting3.remote.ServerConnectionOpenListener$Initial.handleEvent(ServerConnectionOpenListener.java:238)
	at org.jboss.remoting3.remote.ServerConnectionOpenListener$Initial.handleEvent(ServerConnectionOpenListener.java:141)
	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
	at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
	at io.undertow.protocols.ssl.SslConduit$SslReadReadyHandler.readReady(SslConduit.java:1175)
	at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
	at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
Caused by: java.io.FileNotFoundException: Invalid file path
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at org.xnio.channels.Channels$4.run(Channels.java:993)
	... 12 more
  • When accessing our app, we see recurring NoClassDefFoundErrors for org.xnio.channels.Channels after an initial FileNotFoundException during its :
12:31:39,955 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /app: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.io.IOError: java.io.FileNotFoundException: Invalid file path
	...
Caused by: 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)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.xnio.channels.Channels.<clinit>(Channels.java:1093)
	at io.undertow.servlet.spec.ServletOutputStreamImpl.flushInternal(ServletOutputStreamImpl.java:504)
	at io.undertow.servlet.spec.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:478)
	... 99 more
Caused by: java.io.FileNotFoundException: Invalid file path
	at java.io.FileOutputStream.<init>(FileOutputStream.java:206)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
	at org.xnio.channels.Channels$4.run(Channels.java:1098)
	... 117 more
12:31:41,299 ERROR [io.undertow.request] (default task-1) UT005071: Undertow request failed HttpServerExchange{ GET /app}: java.lang.NoClassDefFoundError: Could not initialize class org.xnio.channels.Channels
	at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:628)
	at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:498)
	at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:587)
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:334)

Resolution

Update the JDK to a version where Content from bugs.openjdk.java.net is not included.JDK-8285445 is fixed, such as Oracle JDK 11.0.15.1 , Oracle JDK 8u333, Red Hat OpenJDK 11.0.15.9-4(RHBA-2022:1750), Red Hat OpenJDK 1.8.0.332-2(RHBA-2022:1749) or later. The JDK fix was to default jdk.io.File.enableADS to true instead of false, the issue was caused by code changes in the JDK which changed the behavior causing the errors unless jdk.io.File.enableADS = true.

EAP 7.4 Update 5 will also include a change such that the JDK will not throw an error when jdk.io.File.enableADS is true or false.

Workaround

As a workaround, if the JDK or EAP cannot be updated now, add the following system property in C:\JBOSS_HOME\bin\standalone.conf.bat below to have the JDK restore the previous behavior:

rem # JVM memory allocation pool parameters - modify as appropriate.
set "JAVA_OPTS=-Xms1G -Xmx1G -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m"

rem # Workaround for JDK-8285445                           <<<== add this line
set "JAVA_OPTS=%JAVA_OPTS% -Djdk.io.File.enableADS=true"   <<<===

rem # Prefer IPv4
set "JAVA_OPTS=%JAVA_OPTS% -Djava.net.preferIPv4Stack=true"

Root Cause

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.