Admin UI REST EndPoints throw large org.apache.cxf.interceptor.Fault stack traces


The admin-ng EndPoints intentionally throw known/catchable/gracefullyhandlable Opencast Exceptions from its endpoints.
It is more appropriate if the admin-ng catches and handles the known exceptions and retuned an HTTP style response, for example 404, to the client of the endpoint (i.e. admin-ui). This would avoid confusing stack traces in the logs.

Example Scenario of the issue:
A call to " /admin-ng/event/2c4ead62-1146-4ffc-9e5d-47721edc2a2c/scheduling.json" for a mpId that is recently scheduled from admin-ui but the Scheduler Service has not yet got the update (for reasons of slow activeMQ or overworked admin, etc.).

The admin-ng scheduling.json queries the SchedulerService for data about this mpId. The Scheduler Service doesn't know about it yet, so the Scheduler Service throws a clearly declared and catchable NotFoundException which admin-ng intentionally passes along out it's REST endpoint.

These are the known exceptions thrown by admin-ng scheduling.json
throws NotFoundException, UnauthorizedException, SearchIndexException

This non-HTTP reponse java exception from admin-ng is caught by org.apache.cxf.jaxrs.interceptor and handled and logged in a large stack dump to the Opencast logs.

Example of Scheduler Service's own REST Endpoint handling of the Scheduler Service's NotFoundException


Karen Dolan
January 28, 2019, 1:48 PM

FYI - asking about the rational for converting Java NotFound exceptions to custom Opencast NotFound exceptions on list. A benefit of using Java exceptions, when possible, is that CXF can convert many java exceptions to appropriate HTTP responses, but does not know how to handle custom Opencast exceptions that do not extend Java exception classes.

Karen Dolan
January 8, 2019, 9:50 PM

Note: This is a policy versus technical issue. [EDIT] move the debate to a pull

Your pinned fields
Click on the next to a field label to start pinning.




Karen Dolan