}
LOGGER.warn("Unexpected exception.", e);
if (e.getClass().getPackage().getName().matches("javax?\\..+")) {
if (e instanceof Exception) {
throw new MBeanException((Exception) e, e.getMessage());
}
throw new MBeanException(
new RuntimeException(e), e.getMessage());
}
throw new MBeanException(new RuntimeException(
e.getClass().getName() + ": " + e.getMessage()),
e.getMessage());
}