New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide error page support #1973
Comments
I don't think it's a bug in Atmosphere. This message is from the Servlet Spec: "Invalid request state. AsyncContext#startAsync not supported. Make sure async-supported is set to true in web.xml". Also please try at least with |
The log message is produced in the AsynchronousProcessor of the atmosphere framework: if (isServlet30 && !req.isAsyncSupported()) {
logger.error("Invalid request state. AsyncContext#startAsync not supported. Make sure async-supported is set to true in web.xml");
res.setStatus(501);
res.addHeader(X_ATMOSPHERE_ERROR, "AsyncContext not enabled");
res.flushBuffer();
return new Action();
} This conditional block was added from version 2.1.4 to 2.1.5. (See your commit 83ec6b8) If it is not a bug of atmosphere, can you please give me an advice/workaround for generating error pages that should be rendered by Wicket (defined in the atmosphere.xml)? |
With version
|
Yes, this is a bug in your application. Like I said, this is a Servlet Spec mandatory deployment descriptor. If Atmosphere gets called without it, then it fail as expected. Take a look at the definition of 'HttpServletRequest#isAsyncSupported()' for more information. But for sure nothing can be done here. Make sure |
<error-page>
<error-code>403</error-code>
<location>/forbidden.html</location> <!-- forbidden.html is a mount to the Wicket page: AccessDeniedPage.java -->
</error-page>
<error-page>
<error-code>404</error-code>
<location>/notFound.html</location> <!-- forbidden.html is a mount to the Wicket page: PageNotFoundPage.java -->
</error-page> I think it is a general problem: If error pages should be generated by a framework like Wicket, Vaadin, GWT, or etc. that is used with the AtmosphereServlet, then you will not get it but only a blank page with the error code 501. As a workaround i will have to generate the error pages with simple jsp files. |
@cwellekoetter I still fail to understand why the error page ends up within Atmosphere? But I'm open to suggestion about helping the issue. Can you share a test case? Also if you remove the code that generate the 501, does it work? |
With As you can see in the web.xml snippet, that i posted for this task, every request loops through the AtmosphereServlet. I have only one atmosphere handler configured, that dispatches all requests to the Wicket Filter, as you can see in the atmosphere.xml snippet above. If I request a resource, that does not exist / that Wicket cannot handle, then the default error configuration of tomcat will act: <error-page>
<error-code>404</error-code>
<location>/notFound.html</location> <!-- notFound.html is a mount to the Wicket page: PageNotFoundPage.java -->
</error-page> The location "/notFound.html" is not a resource in the webroot, but should be handled by Wicket. |
Rollback #1637 to allow framework that runs on top of Atmosphere via the 'ReflectorServletProcessor' to handler error pages. |
I am using atmosphere-runtime:2.1.4 along with a current Apache-Tomcat:7.0.59+ and Wicket integration (Apache-Wicket:6.18.0, org.apache.wicket.experimental.wicket6:wicket-atmosphere:0.19). All pages and resources (including the error pages) are served by Wicket, which is integrated in the AtmosphereServlet.
After updating the wicket-atmosphere artifact to a newer version (0.20-0.22), which use a newer atmosphere-runtime ( 2.1.4+) we get empty error pages with HTTP-Status-Code 501. Also we get the following log message: "Invalid request state. AsyncContext#startAsync not supported. Make sure async-supported is set to true in web.xml".
After some investigation I found out which code change is responsible for this behavior, I found the following commit (line 125ff):
83ec6b8
Following web.xml configuration:
...
Following atmosphere.xml configuration:
PS: Error pages, that are directly forwarded in Wicket (like InternalServerError) work smoothly. Error Pages that are defined in the web.xml, do not work with with the AtmosphereServlet
The text was updated successfully, but these errors were encountered: