测试DEMO时,用undertow报错~~~

JFinal-4.2 action report -------- 2019-06-04 11:27:57 --------------------------

Url         : GET /hello

Controller  : demo.HelloController.(HelloController.java:1)

Method      : index

--------------------------------------------------------------------------------

六月 04, 2019 11:27:57 上午 io.undertow.server.Connectors executeRootHandler

ERROR: UT005071: Undertow request failed HttpServerExchange{ GET /hello request {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8], Accept-Language=[zh-CN,zh;q=0.8], Accept-Encoding=[gzip, deflate, sdch, br], DNT=[1], User-Agent=[Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X MetaSr 1.0], Connection=[keep-alive], Cookie=[UM_distinctid=16afd80cbf219d-051efebde6ae96-4d045769-1fa400-16afd80cbf5746; _ga=GA1.1.56216799.1553488452; CNZZDATA1258001701=1817323507-1559031238-%7C1559031238], Upgrade-Insecure-Requests=[1], Host=[localhost]} response {Expires=[Thu, 01 Jan 1970 00:00:00 GMT], Connection=[keep-alive], Cache-Control=[no-cache], Server=[JFinal], Pragma=[no-cache], Content-Type=[text/plain;charset=UTF-8], Content-Length=[20], Date=[Tue, 04 Jun 2019 03:27:57 GMT]}}

java.lang.NoClassDefFoundError: Could not initialize class org.xnio.conduits.Conduits

at io.undertow.conduits.AbstractFixedLengthStreamSinkConduit.writeFinal(AbstractFixedLengthStreamSinkConduit.java:175)

at org.xnio.conduits.ConduitStreamSinkChannel.writeFinal(ConduitStreamSinkChannel.java:104)

at io.undertow.channels.DetachableStreamSinkChannel.writeFinal(DetachableStreamSinkChannel.java:195)

at io.undertow.server.HttpServerExchange$WriteDispatchChannel.writeFinal(HttpServerExchange.java:2082)

at io.undertow.servlet.spec.ServletOutputStreamImpl.writeBufferBlocking(ServletOutputStreamImpl.java:572)

at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:609)

at io.undertow.servlet.spec.ServletPrintWriter.close(ServletPrintWriter.java:117)

at io.undertow.servlet.spec.ServletPrintWriterDelegate.close(ServletPrintWriterDelegate.java:81)

at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:480)

at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:575)

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

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

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

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

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:272)

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

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

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

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

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

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


评论区

JFinal

2019-06-04 12:07

下功首页的 jfinal demo for maven,然后在本地跑一跑, 然后参考这个 demo 解决一下就好

tydl

2019-06-04 12:11

@JFinal 下载demo也跑不起来

tydl

2019-06-04 12:12

@JFinal JFinal-4.2 action report -------- 2019-06-04 12:12:10 --------------------------
Url : GET /
Controller : com.demo.index.IndexController.(IndexController.java:1)
Method : index
--------------------------------------------------------------------------------

2019-06-04 12:12:10
[ERROR]-[Thread: XNIO-1 task-1]-[io.undertow.server.Connectors.executeRootHandler()]: UT005071: Undertow request failed HttpServerExchange{ GET / request {Accept=[text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8], Accept-Language=[zh-CN,zh;q=0.8], Accept-Encoding=[gzip, deflate, sdch, br], DNT=[1], User-Agent=[Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 SE 2.X MetaSr 1.0], Connection=[keep-alive], Cookie=[UM_distinctid=16afd80cbf219d-051efebde6ae96-4d045769-1fa400-16afd80cbf5746; _ga=GA1.1.56216799.1553488452; CNZZDATA1258001701=1817323507-1559031238-%7C1559031238], Upgrade-Insecure-Requests=[1], Host=[localhost]} response {Content-Encoding=[gzip], Server=[JFinal], Content-Type=[text/html;charset=UTF-8], Content-Length=[1207]}}
java.io.IOError: java.io.FileNotFoundException: NUL: (系统找不到指定的文件。)
at org.xnio.conduits.Conduits$1.run(Conduits.java:237)
at org.xnio.conduits.Conduits$1.run(Conduits.java:227)
at java.security.AccessController.doPrivileged(Native Method)
at org.xnio.conduits.Conduits.(Conduits.java:227)
at io.undertow.conduits.DeflatingStreamSinkConduit.writeFinal(DeflatingStreamSinkConduit.java:174)
at org.xnio.conduits.ConduitStreamSinkChannel.writeFinal(ConduitStreamSinkChannel.java:104)
at io.undertow.channels.DetachableStreamSinkChannel.writeFinal(DetachableStreamSinkChannel.java:195)
at io.undertow.server.HttpServerExchange$WriteDispatchChannel.writeFinal(HttpServerExchange.java:2082)
at io.undertow.servlet.spec.ServletOutputStreamImpl.writeBufferBlocking(ServletOutputStreamImpl.java:572)
at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:609)
at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:486)
at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:575)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:351)
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
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:272)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:364)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.FileNotFoundException: NUL: (系统找不到指定的文件。)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at java.io.FileOutputStream.(FileOutputStream.java:101)
at org.xnio.conduits.Conduits$1.run(Conduits.java:232)
... 25 more

tydl

2019-06-04 12:12

这是 jfinal demo for maven的报错

JFinal

2019-06-04 14:36

@tydl 这个错误极为罕见,还真有一个社区同学碰到过:
问题出在xnio包里底层代码执行new FileOutputStream("NUL:").getChannel(); 的时候报错,最后检查发现是我的系统null.sys文件异常导致,重新下载null.sys文件覆盖然后启动windows服务后就好了

具体的贴子在这里:
https://www.jfinal.com/feedback/5217

按照贴子下方的解决办法去解决

tydl

2019-06-06 12:30

@JFinal 按此方式解决!谢谢~ 注意找网上下载null.sys注意系统版本64 32位,开始找了一个不行,估计是32位的。

附上WIN64的 null.sys地址:链接:https://pan.baidu.com/s/1UtcZizm-iFcVk4OKrnFJVg 密码:1q4d

tydl

2019-06-06 12:31

确定是否正常的命令是:C:\Users\Administrator>sc start null

tydl

2019-06-06 12:32

如反馈出:
SERVICE_NAME: null
TYPE : 1 KERNEL_DRIVER
STATE : 4 RUNNING
(STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
PID : 0
FLAGS :
即为正常

JFinal

2019-06-06 12:32

@tydl 一般是碰不到这个问题的,你的系统文件 null.sys 被破坏掉了才会出这个问题,所以留意系统是否被病毒木马感染

热门反馈

扫码入社