我正在尝试将POST请求正文中的文件发送到我在wildfly 8.2.0中部署的servlet。在我的代码中,我试图使用request.getInputStream()将请求中的文件流读入ServletInputStream对象。这在Jboss 7.X中运行良好。在Wildfly 8.2.0上,下载的servlet处理程序似乎正在进行中。我看到文件流已完全转移到ServletInputStream对象。但即使在100%转让后,承诺似乎也没有释放其线索。不确定它是否存在故障或我在故障模块中错误配置的内容。这里有什么建议吗?
以下是即使在100%转移后仍然卡住的线程的详细信息:
default task-17
sun.nio.ch.PollArrayWrapper.poll0(Native Method)
sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:117)
sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:73)
sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87)
sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98)
sun.nio.ch.SelectorImpl.select(SelectorImpl.java:102)
org.xnio.nio.SelectorUtils.await(SelectorUtils.java:46)
org.xnio.nio.NioSocketConduit.awaitReadable(NioSocketConduit.java:345)
org.xnio.conduits.AbstractSourceConduit.awaitReadable(AbstractSourceConduit.java:66)
io.undertow.conduits.ReadDataStreamSourceConduit.awaitReadable(ReadDataStreamSourceConduit.java:101)
io.undertow.server.protocol.ajp.AjpServerRequestConduit.awaitReadable(AjpServerRequestConduit.java:278)
org.xnio.conduits.ConduitStreamSourceChannel.awaitReadable(ConduitStreamSourceChannel.java:151)
io.undertow.channels.DetachableStreamSourceChannel.awaitReadable(DetachableStreamSourceChannel.java:77)
io.undertow.server.HttpServerExchange$ReadDispatchChannel.awaitReadable(HttpServerExchange.java:1997)
org.xnio.channels.Channels.readBlocking(Channels.java:295)
io.undertow.servlet.spec.ServletInputStreamImpl.readIntoBuffer(ServletInputStreamImpl.java:170)
io.undertow.servlet.spec.ServletInputStreamImpl.read(ServletInputStreamImpl.java:146)
io.undertow.servlet.spec.ServletInputStreamImpl.read(ServletInputStreamImpl.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)
io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)
答案 0 :(得分:0)
我有类似的问题,我的解决方案是在standalone.xml中为ajp监听器设置write-timeout参数:
<subsystem xmlns="urn:jboss:domain:undertow:1.2">
<buffer-cache name="default"/>
<server name="default-server">
<ajp-listener name="ajp-connector" socket-binding="ajp" write-timeout="120000" no-request-timeout="60000" />
我希望它可以帮到你!