@Override
public void run() {
-
- if (getServer() != null) {
- Catalina.this.stop();
- }
-
- // If JULI is used, shut JULI down *after* the server shuts down
- // so log messages aren't lost
- LogManager logManager = LogManager.getLogManager();
- if (logManager instanceof ClassLoaderLogManager) {
- ((ClassLoaderLogManager) logManager).shutdown();
+ try {
+ if (getServer() != null) {
+ Catalina.this.stop();
+ }
+ } catch (Throwable ex) {
+ log.error(sm.getString("catalina.shutdownHookFail"), ex);
+ } finally {
+ // If JULI is used, shut JULI down *after* the server shuts down
+ // so log messages aren't lost
+ LogManager logManager = LogManager.getLogManager();
+ if (logManager instanceof ClassLoaderLogManager) {
+ ((ClassLoaderLogManager) logManager).shutdown();
+ }
}
}
}
# See the License for the specific language governing permissions and
# limitations under the License.
+catalina.shutdownHookFail=The shutdown hook experienced an error while trying to stop the server
catalina.stopServer=No shutdown port configured. Shut down server through OS signal. Server not shut down.
contextConfig.altDDNotFound=alt-dd file {0} not found
contextConfig.applicationUrl=Unable to determine URL for application web.xml