From 9bc71474425b2d74e0f58d669e30eab7b8e5e630 Mon Sep 17 00:00:00 2001 From: Wesley Wannemacher Date: Mon, 21 Sep 2009 15:22:08 +0000 Subject: [PATCH] ww-3230 Rich, you're the man, thanks for the patch! git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@817287 13f79535-47bb-0310-9956-ffa450edef68 --- .../struts2/spring/StrutsSpringObjectFactory.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java b/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java index f82b7996c..13f13a2ea 100644 --- a/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java +++ b/plugins/spring/src/main/java/org/apache/struts2/spring/StrutsSpringObjectFactory.java @@ -76,7 +76,15 @@ public class StrutsSpringObjectFactory extends SpringObjectFactory { 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" +