try {
mserver = Registry.getRegistry(null, null).getMBeanServer();
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
t.printStackTrace(System.out);
System.exit(1);
}
import org.apache.catalina.deploy.ContextResource;
import org.apache.catalina.deploy.ContextResourceLink;
import org.apache.catalina.deploy.NamingResources;
+import org.apache.jasper.util.ExceptionUtils;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
log.error("createMBeans: MBeanException", e);
} catch (Throwable t) {
-
+ ExceptionUtils.handleThrowable(t);
log.error("createMBeans: Throwable", t);
-
}
/*
log.error("destroyMBeans: MBeanException", e);
} catch (Throwable t) {
-
+ ExceptionUtils.handleThrowable(t);
log.error("destroyMBeans: Throwable", t);
-
}
// FIXME: RMI adaptor should be stopped; however, this is
// undocumented in MX4J, and reports exist in the MX4J bug DB that
e = t;
log.error("processContainerAddChild: MBeanException", e);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error("processContainerAddChild: Throwable", t);
}
e = t;
log.error("processContainerRemoveChild: MBeanException", e);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error("processContainerRemoveChild: Throwable", t);
}
import org.apache.catalina.LifecycleException;
import org.apache.catalina.authenticator.Constants;
import org.apache.catalina.util.LifecycleBase;
+import org.apache.jasper.util.ExceptionUtils;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
try {
loginContext = new LoginContext(appName, callbackHandler);
} catch (Throwable e) {
+ ExceptionUtils.handleThrowable(e);
log.error(sm.getString("jaasRealm.unexpectedError"), e);
return (null);
} finally {
log.warn(sm.getString("jaasRealm.loginException", username), e);
return (null);
} catch (Throwable e) {
+ ExceptionUtils.handleThrowable(e);
log.error(sm.getString("jaasRealm.unexpectedError"), e);
return (null);
}
Class<?> clazz = Class.forName(driverName);
driver = (Driver) clazz.newInstance();
} catch (Throwable e) {
+ ExceptionUtils.handleThrowable(e);
throw new SQLException(e.getMessage());
}
}
import org.apache.catalina.UserDatabase;
import org.apache.catalina.core.StandardServer;
import org.apache.catalina.util.LifecycleBase;
+import org.apache.jasper.util.ExceptionUtils;
/**
((StandardServer)getServer()).getGlobalNamingContext();
database = (UserDatabase) context.lookup(resourceName);
} catch (Throwable e) {
+ ExceptionUtils.handleThrowable(e);
containerLog.error(sm.getString("userDatabaseRealm.lookup",
resourceName),
e);
try {
load();
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error(sm.getString("standardManager.managerLoad"), t);
}
try {
unload();
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error(sm.getString("standardManager.managerUnload"), t);
}
import org.apache.catalina.realm.GenericPrincipal;
import org.apache.catalina.security.SecurityUtil;
import org.apache.catalina.util.Enumerator;
+import org.apache.jasper.util.ExceptionUtils;
import org.apache.tomcat.util.res.StringManager;
/**
"afterSessionCreated",
listener);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
try {
fireContainerEvent(context,
"afterSessionCreated",
"afterSessionDestroyed",
listener);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
try {
fireContainerEvent(context,
"afterSessionDestroyed",
((HttpSessionActivationListener)attribute)
.sessionWillPassivate(event);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
manager.getContainer().getLogger().error
(sm.getString("standardSession.attributeEvent"), t);
}
((HttpSessionActivationListener)attribute)
.sessionDidActivate(event);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
manager.getContainer().getLogger().error
(sm.getString("standardSession.attributeEvent"), t);
}
((HttpSessionBindingListener) unbound).valueUnbound
(new HttpSessionBindingEvent(getSession(), name));
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
manager.getContainer().getLogger().error
(sm.getString("standardSession.bindingEvent"), t);
}
listener);
}
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
try {
if (unbound != null) {
fireContainerEvent(context,
"afterSessionAttributeRemoved",
listener);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
try {
fireContainerEvent(context,
"afterSessionAttributeRemoved",
import org.apache.catalina.Globals;
import org.apache.catalina.security.SecurityClassLoad;
+import org.apache.jasper.util.ExceptionUtils;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
catalinaLoader = createClassLoader("server", commonLoader);
sharedLoader = createClassLoader("shared", commonLoader);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error("Class loader creation threw exception", t);
System.exit(1);
}
try {
bootstrap.init();
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
t.printStackTrace();
return;
}
log.warn("Bootstrap: command \"" + command + "\" does not exist.");
}
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
t.printStackTrace();
}
import org.apache.catalina.Server;
import org.apache.catalina.core.StandardServer;
import org.apache.catalina.security.SecurityConfig;
+import org.apache.jasper.util.ExceptionUtils;
import org.apache.juli.ClassLoaderLogManager;
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.digester.Digester;
}
}
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
// This will fail on JDK 1.2. Ignoring, as Tomcat can run
// fine without the shutdown hook.
}
}
}
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
// This will fail on JDK 1.2. Ignoring, as Tomcat can run
// fine without the shutdown hook.
}
Catalina.this.stop();
}
} catch (Throwable ex) {
+ ExceptionUtils.handleThrowable(ex);
log.error(sm.getString("catalina.shutdownHookFail"), ex);
} finally {
// If JULI is used, shut JULI down *after* the server shuts down
properties.load(is);
is.close();
} catch (Throwable t) {
+ handleThrowable(t);
error = t;
}
}
Class<?> authenticatorClass = Class.forName(authenticatorName);
authenticator = (Valve) authenticatorClass.newInstance();
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error(sm.getString(
"contextConfig.authenticatorInstantiate",
authenticatorName),
}
}
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error(sm.getString("hostConfig.deployDescriptor.error",
file), t);
}
addWatchedResources(deployedApp, null, context);
}
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error(sm.getString("hostConfig.deployWar.error", file), t);
}
}
addWatchedResources(deployedApp, dir.getAbsolutePath(), context);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error(sm.getString("hostConfig.deployDir.error", file), t);
}
try {
host.removeChild(context);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.warn(sm.getString
("hostConfig.context.remove", app.name), t);
}
try {
context.destroy();
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.warn(sm.getString
("hostConfig.context.destroy", app.name), t);
}
try {
host.removeChild(context);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.warn(sm.getString
("hostConfig.context.remove", app.name), t);
}
try {
context.destroy();
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.warn(sm.getString
("hostConfig.context.destroy", app.name), t);
}
try {
host.removeChild(host.findChild(apps[i].name));
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.warn(sm.getString
("hostConfig.context.remove", apps[i].name), t);
}
try {
stream.close();
} catch (Throwable t) {
- // do nothing
+ ExceptionUtils.handleThrowable(t);
}
}
}
try {
stream.close();
} catch (Throwable t) {
- // do nothing
+ ExceptionUtils.handleThrowable(t);
}
}
}
try {
resourceStream.close();
} catch (Throwable t) {
- // do nothing
+ ExceptionUtils.handleThrowable(t);
}
}
}
import java.util.ArrayList;
import org.apache.catalina.Globals;
+import org.apache.jasper.util.ExceptionUtils;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
packed.toArray(new File[0]),
null);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error("Class loader creation threw exception", t);
System.exit(1);
}
log.debug("Loading application class " + className);
clazz = classLoader.loadClass(className);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error("Exception creating instance of " + className, t);
System.exit(1);
}
paramTypes[0] = params.getClass();
method = clazz.getMethod(methodName, paramTypes);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error("Exception locating main() method", t);
System.exit(1);
}
paramValues[0] = params;
method.invoke(null, paramValues);
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error("Exception calling main() method", t);
System.exit(1);
}
import org.apache.catalina.tribes.io.ChannelData;
import org.apache.catalina.tribes.io.XByteBuffer;
import org.apache.catalina.tribes.util.ExecutorFactory;
+import org.apache.jasper.util.ExceptionUtils;
/**
* A <b>membership</b> implementation using simple multicast.
if (data[i]!=null && !member.equals(data[i].getAddress())) {
msgservice.messageReceived(data[i]);
}
- }catch (Throwable t) {
+ } catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
log.error("Unable to receive broadcast message.",t);
}
}
import org.apache.catalina.tribes.transport.ReceiverBase;
import org.apache.catalina.tribes.transport.RxTaskPool;
import org.apache.catalina.tribes.util.StringManager;
+import org.apache.jasper.util.ExceptionUtils;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
} catch (java.nio.channels.CancelledKeyException nx) {
log.warn("Replication client disconnected, error when polling key. Ignoring client.");
} catch (Throwable x) {
- try {
- log.error("Unable to process request in NioReceiver", x);
- }catch ( Throwable tx ) {
- //in case an out of memory error, will affect the logging framework as well
- tx.printStackTrace();
- }
+ ExceptionUtils.handleThrowable(x);
+ log.error("Unable to process request in NioReceiver", x);
}
}
import java.util.Locale;
import java.util.Properties;
+import org.apache.jasper.util.ExceptionUtils;
+
/**
map.load(stream);
stream.close();
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
throw new IllegalArgumentException(t.toString());
}
}
import java.io.InputStream;
import java.util.Properties;
+import org.apache.jasper.util.ExceptionUtils;
+
/**
* Simple utility module to make it easy to plug in the server identifier
serverBuilt = props.getProperty("server.built");
serverNumber = props.getProperty("server.number");
} catch (Throwable t) {
- //Ignore
+ ExceptionUtils.handleThrowable(t);
}
if (serverInfo == null)
serverInfo = "Apache Tomcat 7.0.x-dev";
import org.apache.catalina.connector.Response;
import org.apache.catalina.util.LifecycleBase;
import org.apache.coyote.RequestInfo;
+import org.apache.jasper.util.ExceptionUtils;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.tomcat.util.res.StringManager;
try {
holder.renameTo(new File(newFileName));
} catch (Throwable e) {
+ ExceptionUtils.handleThrowable(e);
log.error("rotate failed", e);
}
try {
close();
} catch (Throwable e) {
+ ExceptionUtils.handleThrowable(e);
log.info("at least this wasn't swallowed", e);
}
try {
index = Integer.parseInt(month) - 1;
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
index = 0; // Can not happen, in theory
}
return (months[index]);
try {
init = InetAddress.getLocalHost().getHostAddress();
} catch (Throwable e) {
+ ExceptionUtils.handleThrowable(e);
init = "127.0.0.1";
}
LOCAL_ADDR_VALUE = init;
response.setContentType("text/html");
response.setCharacterEncoding("utf-8");
} catch (Throwable t) {
+ ExceptionUtils.handleThrowable(t);
if (container.getLogger().isDebugEnabled())
container.getLogger().debug("status.setContentType", t);
}
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.util.ServerInfo;
+import org.apache.jasper.util.ExceptionUtils;
import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
if ("".equals(svalue))
return "-";
} catch (Throwable e) {
+ ExceptionUtils.handleThrowable(e);
/* Log error */
return "-";
}
try {
value = InetAddress.getLocalHost().getHostName();
} catch (Throwable e) {
+ ExceptionUtils.handleThrowable(e);
value = "localhost";
}
buf.append(value);
Class<?> clazz = Class.forName(driverName);
driver = (Driver) clazz.newInstance();
} catch (Throwable e) {
+ ExceptionUtils.handleThrowable(e);
throw new SQLException(e.getMessage());
}
}