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" +