1 Reply Latest reply on Apr 8, 2011 4:09 AM by Isaac Salgueiro

    How to stop JBoss from wrapping all errors in HTML

    Kevin Mandeville Newbie

      I have a web service application that is deployed to Jboss AS and I'm running into a situation where when my application throws an error like a 401 or a 404, etc, I expect it to display the error code as well as a message that is set in my application. This is happening, but JBoss appears to be wrapping the whole thing in HTML as if it needs to be displayed in a browser.

       

      I've found out about ErrorReportValve that it seems to be using by default that is doing this prettifying of the errors, but I'm unsure about how to disable this. If I set the errorReportValveClass property of the Host to "" then I get no error messages at all, so clearly that is not the solution. How do I get JBoss to just print out exactly what is in the errText in this method call (the call I'm using to return errors to the web service client) and not wrap it in HTML:

       

      response.sendError(context.getStatusCode(), errText);

       

       

      Please help.