IllegalArgumentException - 'No servlet context to dispatch to' 异步 servlet 的 undertow 错误
IllegalArgumentException - 'No servlet context to dispatch to' error in undertow for async servlet
undertow 尝试发送 httpresponse 时出现以下错误。
java.lang.IllegalArgumentException: UT010046: No servlet context at to dispatch to
at io.undertow.servlet.spec.AsyncContextImpl.dispatch(AsyncContextImpl.java:173) [undertow-servlet-1.1.0.Final.jar!/:1.1.0.Final]
at org.eclipse.jetty.continuation.Servlet3Continuation.resume(Servlet3Continuation.java:152) ~[jetty-continuation.jar:8.1.3.v20120416]
at com.xyz.xyzapp.apihandler.util.AsyncJobWaitingAPIHandler$MultiJobCompletionContext.onListenerCompletion(AsyncJobWaitingAPIHandler.java:460) ~[xyzapp-apihandler.jar:1.4.1-2015.10.dev]
at com.xyz.xyzapp.apihandler.util.AsyncJobWaitingAPIHandler$MultiJobCompletionListener.onCompletion(AsyncJobWaitingAPIHandler.java:492) ~[xyzapp-apihandler.jar:1.4.1-2015.10.dev]
at com.xyz.xyzapp.job.JobEngine.onEvent(JobEngine.java:274) ~[xyzapp-job.jar:1.4.1-2015.10.dev]
at com.xyz.xyzapp.job.JobEngine.onEvent(JobEngine.java:269) ~[xyzapp-job.jar:1.4.1-2015.10.dev]
at com.xyz.xyzapp.core.event.multicast.LocalMulticastEventManager.run(LocalMulticastEventManager.java:134) ~[xyzapp-core.jar:1.4.1-2015.10.dev]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53) ~[spring-context.jar:3.2.9.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_51]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_51]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_51]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_51]
我正在使用 Jetty.Continuation (8.1.3) 来暂停 HTTP 请求。我有部署在 wildfly (8.2.0.Final) 中的 spring (3.2.9) 应用程序。 Spring servlet是通过web配置的-fragment.xml表示servlet是异步的
<servlet>
<servlet-name>apis</servlet-name>
<servlet-class>com.xyz.xyzapp.server.common.spring.ClassloaderOverridingDispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
当其中一项工作(工作是内部框架)完成时,它需要响应客户端(无论谁在听)
该工作已完成。在此工作流程中,出现上述错误。
我确保 wildfly 已启动并且 运行,客户实际上正在等待响应。
这是与 Jboss 6.1.0.Final/Tomcat 一起工作的。
可能是什么问题?我需要在 standalone-full.xml 中添加任何配置以实现 undertow 吗?似乎 undertow 关闭了 HTTP 请求,不确定。
当我使用此处发布的示例时 https://examples.javacodegeeks.com/enterprise-java/jetty/jetty-continuations-example/ , it perfectly worked for me with same version of jboss, and jetty. Then I modified the example war to listen on '/' root context , the problem started showing up. It turns out to be undertow bug is causing this exception. https://issues.jboss.org/browse/UNDERTOW-352。
我们升级到 8.2。1.Final 版本的 wildfly 修复了 undertow 并将 jetty 升级到最新版本以解决问题。
undertow 尝试发送 httpresponse 时出现以下错误。
java.lang.IllegalArgumentException: UT010046: No servlet context at to dispatch to
at io.undertow.servlet.spec.AsyncContextImpl.dispatch(AsyncContextImpl.java:173) [undertow-servlet-1.1.0.Final.jar!/:1.1.0.Final]
at org.eclipse.jetty.continuation.Servlet3Continuation.resume(Servlet3Continuation.java:152) ~[jetty-continuation.jar:8.1.3.v20120416]
at com.xyz.xyzapp.apihandler.util.AsyncJobWaitingAPIHandler$MultiJobCompletionContext.onListenerCompletion(AsyncJobWaitingAPIHandler.java:460) ~[xyzapp-apihandler.jar:1.4.1-2015.10.dev]
at com.xyz.xyzapp.apihandler.util.AsyncJobWaitingAPIHandler$MultiJobCompletionListener.onCompletion(AsyncJobWaitingAPIHandler.java:492) ~[xyzapp-apihandler.jar:1.4.1-2015.10.dev]
at com.xyz.xyzapp.job.JobEngine.onEvent(JobEngine.java:274) ~[xyzapp-job.jar:1.4.1-2015.10.dev]
at com.xyz.xyzapp.job.JobEngine.onEvent(JobEngine.java:269) ~[xyzapp-job.jar:1.4.1-2015.10.dev]
at com.xyz.xyzapp.core.event.multicast.LocalMulticastEventManager.run(LocalMulticastEventManager.java:134) ~[xyzapp-core.jar:1.4.1-2015.10.dev]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53) ~[spring-context.jar:3.2.9.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_51]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_51]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_51]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_51]
我正在使用 Jetty.Continuation (8.1.3) 来暂停 HTTP 请求。我有部署在 wildfly (8.2.0.Final) 中的 spring (3.2.9) 应用程序。 Spring servlet是通过web配置的-fragment.xml表示servlet是异步的
<servlet>
<servlet-name>apis</servlet-name>
<servlet-class>com.xyz.xyzapp.server.common.spring.ClassloaderOverridingDispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<async-supported>true</async-supported>
</servlet>
当其中一项工作(工作是内部框架)完成时,它需要响应客户端(无论谁在听) 该工作已完成。在此工作流程中,出现上述错误。
我确保 wildfly 已启动并且 运行,客户实际上正在等待响应。
这是与 Jboss 6.1.0.Final/Tomcat 一起工作的。
可能是什么问题?我需要在 standalone-full.xml 中添加任何配置以实现 undertow 吗?似乎 undertow 关闭了 HTTP 请求,不确定。
当我使用此处发布的示例时 https://examples.javacodegeeks.com/enterprise-java/jetty/jetty-continuations-example/ , it perfectly worked for me with same version of jboss, and jetty. Then I modified the example war to listen on '/' root context , the problem started showing up. It turns out to be undertow bug is causing this exception. https://issues.jboss.org/browse/UNDERTOW-352。
我们升级到 8.2。1.Final 版本的 wildfly 修复了 undertow 并将 jetty 升级到最新版本以解决问题。