struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r817287 - /struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java
Date Mon, 21 Sep 2009 15:22:10 GMT
Author: wesw
Date: Mon Sep 21 15:22:08 2009
New Revision: 817287

URL: http://svn.apache.org/viewvc?rev=817287&view=rev
Log:
ww-3230
Rich, you're the man, thanks for the patch!

Modified:
    struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java

Modified: struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java?rev=817287&r1=817286&r2=817287&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java
(original)
+++ struts/struts2/trunk/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java
Mon Sep 21 15:22:08 2009
@@ -76,7 +76,15 @@
         boolean useClassCache = "true".equals(useClassCacheStr);
         LOG.info("Initializing Struts-Spring integration...");
 
-        ApplicationContext appContext = (ApplicationContext) servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
+        Object rootWebApplicationContext =  servletContext.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
+
+        if(rootWebApplicationContext instanceof RuntimeException){
+            RuntimeException runtimeException = (RuntimeException)rootWebApplicationContext;
+            LOG.fatal(runtimeException.getMessage());
+            return;
+        }
+
+        ApplicationContext appContext = (ApplicationContext) rootWebApplicationContext;
         if (appContext == null) {
             // uh oh! looks like the lifecycle listener wasn't installed. Let's inform the
user
             String message = "********** FATAL ERROR STARTING UP STRUTS-SPRING INTEGRATION
**********\n" +



Mime
View raw message