Short summary:
1) Jersey (javax.ws.rs implementation in Glassfish) has an OOB mechanism of exception handling, more generic than writing try/catch for each particular service method.
2) By default Jersey handles runtime exceptions by wrapping them into WebApplicationException.
3) If you prefer more control, use the examples on the link I gave above.
There's a much more elegant way of handling exceptions in RS. This way is not reusable and looks a bit dirty. Please find a good guide here: http://www.codingpedia.org/ama/error-handling-in-rest-api-with-jersey/
Short summary: 1) Jersey (javax.ws.rs implementation in Glassfish) has an OOB mechanism of exception handling, more generic than writing try/catch for each particular service method. 2) By default Jersey handles runtime exceptions by wrapping them into WebApplicationException. 3) If you prefer more control, use the examples on the link I gave above.