[weld-commits] Weld SVN: r4873 - extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Mon Nov 9 12:36:10 EST 2009


Author: dan.j.allen
Date: 2009-11-09 12:36:10 -0500 (Mon, 09 Nov 2009)
New Revision: 4873

Modified:
   extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java
Log:
check for org.apache.AnnotationProcessor before referencing WeldAnnotationProcessor on shutdown


Modified: extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java
===================================================================
--- extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java	2009-11-09 17:32:56 UTC (rev 4872)
+++ extensions/trunk/servlet/int/src/main/java/org/jboss/weld/environment/servlet/Listener.java	2009-11-09 17:36:10 UTC (rev 4873)
@@ -16,27 +16,13 @@
  */
 package org.jboss.weld.environment.servlet;
 
-import javax.el.ELContextListener;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.jsp.JspApplicationContext;
-import javax.servlet.jsp.JspFactory;
+import java.util.logging.Logger;
 
-import org.jboss.weld.bootstrap.api.Bootstrap;
-import org.jboss.weld.bootstrap.api.Environments;
-import org.jboss.weld.context.api.BeanStore;
-import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
 import org.jboss.weld.environment.servlet.deployment.ServletDeployment;
 import org.jboss.weld.environment.servlet.services.ServletResourceInjectionServices;
 import org.jboss.weld.environment.servlet.services.ServletServicesImpl;
 import org.jboss.weld.environment.servlet.util.Reflections;
 import org.jboss.weld.environment.tomcat.WeldAnnotationProcessor;
-import org.jboss.weld.injection.spi.ResourceInjectionServices;
-import org.jboss.weld.manager.api.WeldManager;
-import org.jboss.weld.servlet.api.ServletListener;
-import org.jboss.weld.servlet.api.ServletServices;
-import org.jboss.weld.servlet.api.helpers.ForwardingServletListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * @author Pete Muir
@@ -78,7 +64,12 @@
    public void contextDestroyed(ServletContextEvent sce)
    {
       bootstrap.shutdown();
-      sce.getServletContext().removeAttribute(WeldAnnotationProcessor.class.getName());
+      try
+      {
+         Reflections.classForName("org.apache.AnnotationProcessor");
+         sce.getServletContext().removeAttribute(WeldAnnotationProcessor.class.getName());
+      }
+      catch (IllegalArgumentException e) {}
       super.contextDestroyed(sce);
    }
 



More information about the weld-commits mailing list