You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Christian Amend (JIRA)" <ji...@apache.org> on 2014/12/17 17:54:13 UTC

[jira] [Resolved] (OLINGO-492) Custom ODataErrorCallback is not called when ODataServlet is used

     [ https://issues.apache.org/jira/browse/OLINGO-492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Amend resolved OLINGO-492.
------------------------------------
       Resolution: Fixed
    Fix Version/s: V2 2.0.2
         Assignee: Christian Amend  (was: Michael Bolz)

Fixed with commit https://git-wip-us.apache.org/repos/asf?p=olingo-odata2.git;a=commit;h=f40ea94c83f5e94fba8cdca98241a64735929222

> Custom ODataErrorCallback is not called when ODataServlet is used
> -----------------------------------------------------------------
>
>                 Key: OLINGO-492
>                 URL: https://issues.apache.org/jira/browse/OLINGO-492
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core
>    Affects Versions: V2 2.0.1
>            Reporter: Vitali Yarmolik
>            Assignee: Christian Amend
>             Fix For: V2 2.0.2
>
>
> We have an OData service which has custom implementation of {{ODataErrorCallback}} for service-specific error handling. In order to remove CXF dependencies we decided to use the recently introduced {{ODataServlet}} instead of {{CXFNonSpringJaxrsServlet}} in web.xml. After that I noticed that our custom error callback is not called in some cases. Looking into the source code of the library I can name the following reasons for that:
> # When an instance of {{ODataException}} is thrown during the call of {{ODataServiceFactory.createService(ODataContext)}} method, the exception is caught in {{ODataServlet.handleRequest(HttpServletRequest, ODataHttpMethod, HttpServletResponse)}} method. In this case, {{org.apache.olingo.odata2.core.*servlet*.ODataExceptionWrapper}} class is used for the exception handling. The problem is that this class does not use the custom error callback implementation in its {{wrapInExceptionResponse(Exception)}} method.
> # In case an exception other than {{ODataException}} is thrown in {{ODataServlet.handleRequest(HttpServletRequest, ODataHttpMethod, HttpServletResponse)}} method (e.g. RuntimeException or an application-specific exception), it will not be caught in the {{handleRequest}} method at all. As a result, the exception will be handled by the web server and the HTTP response will not be formatted according to the OData specification. Obviously, the custom OData error callback is not called in this case either.
> The custom OData error callback is used fine in both the aforementioned situations in case {{CXFNonSpringJaxrsServlet}} is specified in web.xml.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)