You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by mu...@apache.org on 2009/04/02 21:12:20 UTC
svn commit: r761381 -
/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
Author: musachy
Date: Thu Apr 2 19:12:19 2009
New Revision: 761381
URL: http://svn.apache.org/viewvc?rev=761381&view=rev
Log:
WW-3026 Log exceptions when initialization fails
Modified:
struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java?rev=761381&r1=761380&r2=761381&view=diff
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java Thu Apr 2 19:12:19 2009
@@ -41,6 +41,7 @@
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsStatics;
+import org.apache.struts2.StrutsException;
import org.apache.struts2.config.BeanSelectionProvider;
import org.apache.struts2.config.DefaultPropertiesProvider;
import org.apache.struts2.config.LegacyPropertiesConfigurationProvider;
@@ -396,22 +397,28 @@
configurationManager = new ConfigurationManager(BeanSelectionProvider.DEFAULT_BEAN_NAME);
}
- init_DefaultProperties(); // [1]
- init_TraditionalXmlConfigurations(); // [2]
- init_LegacyStrutsProperties(); // [3]
- init_CustomConfigurationProviders(); // [5]
- init_FilterInitParameters() ; // [6]
- init_AliasStandardObjects() ; // [7]
-
- Container container = init_PreloadConfiguration();
- container.inject(this);
- init_CheckConfigurationReloading(container);
- init_CheckWebLogicWorkaround(container);
-
- if (!dispatcherListeners.isEmpty()) {
- for (DispatcherListener l : dispatcherListeners) {
- l.dispatcherInitialized(this);
+ try {
+ init_DefaultProperties(); // [1]
+ init_TraditionalXmlConfigurations(); // [2]
+ init_LegacyStrutsProperties(); // [3]
+ init_CustomConfigurationProviders(); // [5]
+ init_FilterInitParameters() ; // [6]
+ init_AliasStandardObjects() ; // [7]
+
+ Container container = init_PreloadConfiguration();
+ container.inject(this);
+ init_CheckConfigurationReloading(container);
+ init_CheckWebLogicWorkaround(container);
+
+ if (!dispatcherListeners.isEmpty()) {
+ for (DispatcherListener l : dispatcherListeners) {
+ l.dispatcherInitialized(this);
+ }
}
+ } catch (Exception ex) {
+ if (LOG.isErrorEnabled())
+ LOG.error("Dispatcher initialization failed", ex);
+ throw new StrutsException(ex);
}
}