[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3265) RESTEasy exception handling

Jozef Hartinger (JIRA) jira-events at lists.jboss.org
Sun Mar 15 13:30:22 EDT 2009

    [ https://jira.jboss.org/jira/browse/JBSEAM-3265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12457320#action_12457320 ] 

Jozef Hartinger commented on JBSEAM-3265:

Looks like in the meantime code changes in RESTEasy solved this issue. If exception appears, RESTEasy's SynchronousDispatcher now throws UnhandledException if there is no ExceptionMapper to take care of the primary exception. Exception bubbles out of the invoke() call and can be handled by pages.xml ExceptionHandler like this:

<exception class="org.jboss.seam.framework.EntityNotFoundException">
  <http-error error-code="404" />

> RESTEasy exception handling
> ---------------------------
>                 Key: JBSEAM-3265
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3265
>             Project: Seam
>          Issue Type: Task
>          Components: WS
>            Reporter: Christian Bauer
>            Assignee: Christian Bauer
> JAX-RS specifies the ExceptionMapper providers: The job of an ExceptionMapper is to convert an Exception instance to an HttpResponse. 
> Two issues with that:
> RESTEasy does all that internally, that means once we dispatch a request to RESTEasy, we'll never get an exception out of the dispatcher call, only an HttpResponse. So we can't do internal cleanup of Seam contexts after an exception occurs.
> Second problem is that Seam has exactly the same functionality built-in, with ExceptionHandler and pages.xml declarations of mappings. So we definitely should give users the option to use that instead of writing a dozen ExceptionMapper classes. To get this working we need to get the exception out of the dispatcher invocation, to either call RESTEasy ExceptionMappers from outside of the dispatcher or to let it bubble up to the Seam ExceptionHandler so pages.xml can be used.
> This requires a rewrite of the exception handling in RESTEasy, the issue has been brought up on their dev mailing list.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the seam-issues mailing list