Author: jason.greene(a)jboss.com
Date: 2009-04-24 17:26:16 -0400 (Fri, 24 Apr 2009)
New Revision: 338
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupFilter.java
trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupListener.java
Log:
Don't initialize on undeploy
Modified: trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupFilter.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupFilter.java 2009-04-24
21:20:37 UTC (rev 337)
+++ trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupFilter.java 2009-04-24
21:26:16 UTC (rev 338)
@@ -68,12 +68,20 @@
public void destroy()
{
+ if (! initialized)
+ {
+ filter = null;
+ config = null;
+ return;
+ }
+
try
{
init();
}
catch (ServletException e)
{
+ log.error("Filter through an exception during init: ", e);
}
filter.destroy();
@@ -102,7 +110,7 @@
}
catch (Exception e)
{
- throw new IllegalArgumentException("Could not instantiated filter:
" + filterName, e);
+ log.error("Could not instantiated filter: " + filterName, e);
}
filter.init(config);
Modified: trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupListener.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupListener.java 2009-04-24
21:20:37 UTC (rev 337)
+++ trunk/core/src/main/java/org/jboss/on/embedded/LazyStartupListener.java 2009-04-24
21:26:16 UTC (rev 338)
@@ -127,15 +127,11 @@
{
objs[i] = Class.forName(names[i]).newInstance();
}
- catch (InstantiationException e)
+ catch (Exception e)
{
+ log.error("Could not find/load listener: "+ names[i], e);
}
- catch (IllegalAccessException e)
- {
- }
- catch (ClassNotFoundException e)
- {
- }
+
}
for (Object obj : objs)
@@ -251,6 +247,12 @@
public void contextDestroyed(ServletContextEvent event)
{
+ if (! initialized)
+ {
+ contextEvents.clear();
+ return;
+ }
+
initialize();
ArrayList<ServletContextListener> listeners = contextListeners;