dsollen dsollen -4 years ago 118
Java Question

!asyncSupported exception when switch from Jetty 7 to Jetty 9

we recently upgraded our jetty version. when we did this both of our legacy gui war files, which no one has modified in some time, stopped working correctly. I believe I hunted the root cause to the proxy (used to proxy to a restful interface on another port), any call to the proxy throws the exception:

IllegalStateException: !asyncSupported

I'm not sure why this would occure with 1.9 but not with the old jetty. I can't build the war file currently, it was a mess that only one developer could ever build, but I trid unzipping it with jetty -x and ading to the servlet section of the web.xml file this:


and then rezipping it with jar c command. that didn't seem to help, though now i get exceptions in my jetty log fhile while before they would only show in the browser.

can anyone tell me what to do to activate async support and/or why the switch in jetty would cause this?

Answer Source

Ah, the evolution of the spec ...

  • Jetty 7 was Servlet 2.5 (no async there)
  • Jetty 8 was Servlet 3.0 (async introduced) - spec was vague on what was default, so Jetty defaulted to async-supported == true
  • Jetty 9 is Servlet 3.1 (even more async) - the spec was clarified, and jetty chose its default poorly. The default according to the spec is async-supported == false

That's why you didn't have to specify async-supported in the past, but now you do.

Bug about this bugs.eclipse.org/410893

Commit: 9bf7870c7c8a209f2660f63c14dd4acb62b07533

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download