这个奇怪的异常日志,是不是undertow问题?

2019-01-24 14:31:31
[WARN]-[Thread: XNIO-1 task-1]-[com.jfinal.core.ActionHandler.handle()]: 404 Action Not Found: //detail/phpmyadmin

2019-01-24 14:54:41
[ERROR]-[Thread: XNIO-1 task-15]-[com.jfinal.core.ActionHandler.handle()]: /
java.lang.RuntimeException: java.nio.channels.ClosedChannelException
	at com.jfinal.template.io.ByteWriter.close(ByteWriter.java:54)
	at com.jfinal.template.Template.render(Template.java:61)
	at com.jfinal.render.TemplateRender.render(TemplateRender.java:61)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:106)
	at com.qm.qmall.common.handler.UrlSeoHandler.handle(UrlSeoHandler.java:64)
	at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:81)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:86)
	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.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
	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.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
	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:360)
	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.nio.channels.ClosedChannelException
	at io.undertow.channels.DetachableStreamSinkChannel.write(DetachableStreamSinkChannel.java:238)
	at io.undertow.server.HttpServerExchange$WriteDispatchChannel.write(HttpServerExchange.java:2103)
	at io.undertow.servlet.spec.ServletOutputStreamImpl.writeBufferBlocking(ServletOutputStreamImpl.java:574)
	at io.undertow.servlet.spec.ServletOutputStreamImpl.flushInternal(ServletOutputStreamImpl.java:489)
	at io.undertow.servlet.spec.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:476)
	at com.jfinal.template.io.ByteWriter.close(ByteWriter.java:51)
	... 36 more

2019-01-24 14:54:41
[ERROR]-[Thread: XNIO-1 task-15]-[com.jfinal.core.JFinalFilter.doFilter()]: /
java.lang.IllegalStateException: UT010006: Cannot call getWriter(), getOutputStream() already called
	at io.undertow.servlet.spec.HttpServletResponseImpl.getWriter(HttpServletResponseImpl.java:363)
	at com.jfinal.render.ErrorRender.render(ErrorRender.java:60)
	at com.jfinal.core.ActionHandler.handle(ActionHandler.java:122)
	at com.qm.qmall.common.handler.UrlSeoHandler.handle(UrlSeoHandler.java:64)
	at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:81)
	at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:86)
	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.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)
	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.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
	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:360)
	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-01-29 15:18

客户端主动断开连接引起的异常, jfinal 3.6 添加了几行代码避免了这个异常,关注一下这几天要发布的新版本,升到 3.6 即可,整个世界清静了

asen12345

2019-01-29 15:39

JFinal

2019-01-31 00:55

jfinal undertow 1.5 以及 jfinal 3.6 已发布到 maven 中心库,升级用上这两个新版本,所有问题全解决了

asen12345

2019-01-31 13:36

@JFinal 太好了 一开电脑就来更新了

wakeup1026

2019-02-12 16:20

在controller下renderNull()即可。我的就是这么解决的,不清楚好不好反正不报错了

jianggr

2019-02-27 12:28

@JFinal 升级后还是有这个问题 com.jfinal.template.TemplateException: 您的主机中的软件中止了一个已建立的连接。

JFinal

2019-02-27 17:32

@jianggr jfinal undertow 升级到 1.5 了没有?

jianggr

2019-03-03 07:27

@JFinal 升级了1.5加jf3.6

banyue

2019-04-15 10:34

用renderNull 也不行啊 @wakeup1026

JFinal

2019-04-15 11:27

@banyue 升级到 jfinal 3.8 以及 jfinal undertow 1.6

这个问题本身是由于客户端主动断开连接而正常输出的异常,本质不是个问题, 但为了提升用户体验, jfinal 3.8 以及 jfinal undertow 1.6 为此进行了打磨

banyue

2019-04-15 13:58

一直就是网络异常,无法下载

banyue

2019-04-15 14:21

@JFinal 不好意思啊 之前没看到,以前也有个项目也是用jboot的,两个都是我做业务,之前那个下载可以呢,现在这个就这样报错了

banyue

2019-04-15 14:21

@JFinal 就有点不太理解 代码都是一样的

banyue

2019-04-15 17:57

@JFinal 前端问题

JFinal

2019-04-15 19:22

@banyue 解决就好

热门反馈

扫码入社