【已解决】jdk从1.8.0.322升级到1.8.0.332后报IOError

感谢@gisphm 提供的解决办法:

参考
https://bugs.openjdk.java.net/browse/JDK-8285445
https://issues.redhat.com/browse/XNIO-404
https://issues.redhat.com/browse/UNDERTOW-2073
把 undertow的依赖 xnio-api 和 xnio-nio 的版本升级到 3.8.7.Final 就行了。
            <dependency>
                <groupId>org.jboss.xnio</groupId>
                <artifactId>xnio-api</artifactId>
                <version> 3.8.7.Final</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.jboss.threads</groupId>
                        <artifactId>jboss-threads</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.jboss.xnio</groupId>
                <artifactId>xnio-nio</artifactId>
                <version> 3.8.7.Final</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.wildfly.common</groupId>
                        <artifactId>wildfly-common</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>


此外需要将jfinal-undertow升级到3.0



问题描述:

使用的是 jfinal-club-4.9.15

jfinal4.9.x~5.x 均会出现

jdk退回到1.8.0.322就正常了

我常用的是aws 发行的corretto,后来测了eclipse 发行的temurin  同样会出现该错误


https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u332-b09/OpenJDK8U-jdk_x64_windows_hotspot_8u332b09.zip

https://corretto.aws/downloads/latest/amazon-corretto-8-x64-windows-jdk.zip


2022-05-13 12:59:41

[ERROR]-[Thread: XNIO-1 task-1]-[io.undertow.servlet.api.LoggingExceptionHandler.handleThrowable()]: UT005023: Exception handling request to /

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)

at com.jfinal.render.TemplateRender.render(TemplateRender.java:63)

at com.jfinal.core.ActionHandler.handle(ActionHandler.java:113)

at com.jfinal.club.common.handler.UrlSeoHandler.handle(UrlSeoHandler.java:78)

at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:81)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:90)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)

at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)

at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:117)

at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.servlet.handlers.SendErrorPageHandler.handleRequest(SendErrorPageHandler.java:52)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119)

at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:275)

at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:79)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:134)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:131)

at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255)

at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:79)

at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:100)

at io.undertow.server.Connectors.executeRootHandler(Connectors.java:387)

at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:852)

at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)

at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2019)

at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1558)

at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1423)

at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1280)

at java.lang.Thread.run(Thread.java:750)

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)

... 46 more


评论区

zzutligang

2022-05-13 14:45

有没有可能是这两个jdk的兼容性和oracle jdk有差别造成的?

zzutligang

2022-05-13 14:47

另外,实测,在mac上使用Zulu jdk 1.8 m1版本,jfinal运行很稳定。

gisphm

2022-05-13 22:41

参考
https://bugs.openjdk.java.net/browse/JDK-8285445
https://issues.redhat.com/browse/XNIO-404
https://issues.redhat.com/browse/UNDERTOW-2073
把 undertow的依赖 xnio-api 和 xnio-nio 的版本升级到 3.8.7.Final 就行了。
            <dependency>
                <groupId>org.jboss.xnio</groupId>
                <artifactId>xnio-api</artifactId>
                <version> 3.8.7.Final</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.jboss.threads</groupId>
                        <artifactId>jboss-threads</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.jboss.xnio</groupId>
                <artifactId>xnio-nio</artifactId>
                <version> 3.8.7.Final</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.wildfly.common</groupId>
                        <artifactId>wildfly-common</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

JFinal

2022-05-14 14:08

@gisphm 找到最本质的原因了,感谢分享

haojay

2022-05-15 13:39

@gisphm 感谢分享