[cdi-dev] [JBoss JIRA] (CDI-206) Conversation related exceptions cannot be handled

Stuart Douglas (JIRA) jira-events at lists.jboss.org
Thu Aug 30 09:50:32 EDT 2012

    [ https://issues.jboss.org/browse/CDI-206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714869#comment-12714869 ] 

Stuart Douglas commented on CDI-206:

Servlet does specify an ordering for filters, based on the location of <filter-mappings> in web.xml (with various other rules based on building the effective web.xml from fragments) (Servlet 6.2.4).

We could potentially add a filter with a well defined name ("CDI Conversation Filter"), which would give the user the opportunity to add a filter mapping anywhere they want in web.xml. 

If they did not add a mapping we could specify that it executes first (i.e. around every filter). We would probably also have to disallow mappings for anything other than "/*". 
> Conversation related exceptions cannot be handled
> -------------------------------------------------
>                 Key: CDI-206
>                 URL: https://issues.jboss.org/browse/CDI-206
>             Project: CDI Specification Issues
>          Issue Type: Bug
>          Components: Contexts
>    Affects Versions: 1.1.EDR
>            Reporter: Jozef Hartinger
>             Fix For: 1.1 (Proposed)
> This issue emerged after adding support for conversations as part of CDI-80
> The spec says:
> {quote}The conversation associated with a Servlet request is determined at the beginning of the request before calling any
> service() method of any servlet in the web application, calling the doFilter() method of any servlet filter in the web
> application and before the container calls any ServletRequestListener or AsyncListener in the web application.
> {quote}
> and
> {quote}
> If the propagated conversation cannot be restored, the container must associate the request with a new transient conversation and throw an exception of type javax.enterprise.context.NonexistentConversationException.
> The container ensures that a long-running conversation may be associated with at most one request at a time, by blocking
> or rejecting concurrent requests. If the container rejects a request, it must associate the request with a new transient conversation and throw an exception of type javax.enterprise.context.BusyConversationException.
> {quote}
> The conversation association is supposed to be done before any servlet, filter or listener is invoked. If the association fails (due to NonexistentConversationException or BusyConversationException), the application has no way of handling this failure gracefully. The Servlet error-page mechanism cannot be used portably because it is only handling uncaught exceptions thrown from a servlet / filter. Similarly, a commonly used exception handling mechanism - an outer filter that catches every uncaught exception, cannot be used since the association failure does not occur within the filter invocation.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

More information about the cdi-dev mailing list