} finally {
// Unbinding thread
unbindThread(oldCCL);
// Reinitialize logger again. We are done with impersonating
// the web-app execution context.
logger = null;
getLogger();
if (!mainOk) {
// An exception occurred
// Register with JMX anyway, to allow management