private static void sendInternalError(Request request, Response response,
HttpHost host) throws IOException {
// GLASSFISH Request/Response does not extend HttpRequest/Response so
// we need to cast to Coyote Request/Response
CoyoteRequest cRequest = (CoyoteRequest) request;
CoyoteResponse cResponse = (CoyoteResponse) response;
// If the reponse is still not committed...
if (!cResponse.isCommitted()) {
// Failed to proxy this request, inform client.
if (log.isLoggable(Level.FINE)) {
log.log(Level.FINE,
"The attempt to proxy '" + cRequest.getRequestURL() +
"' to '" + host + "' failed. " +
"Responding with 500 Internal Server Error.");
}
cResponse.sendError(CoyoteResponse.SC_INTERNAL_SERVER_ERROR);
}
}