In a resource
the EJBException should be unwrapped and the exception processed by JAXRS according to JAXRS Spec. However, this only happens in about 50% of deployments (tested 15times in a row). It seems that status 201 is returned only when JAXRS container is dealing with it. Sometimes, Status 500 returned and the exception is logged to server log. However, when
asadmin set configs.config.server-config.cdi-service.enable-implicit-cdi=false
Status 201 has been returned 10x in a row, no 500.