mirror of https://github.com/apache/archiva.git
MRM-1066 - Shutdown of Tomcat causes Exception when running Archiva Project
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@744785 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fa4039e25f
commit
db5102aaaf
|
@ -26,6 +26,8 @@ import org.apache.maven.archiva.common.ArchivaException;
|
|||
import org.apache.maven.archiva.scheduled.ArchivaTaskScheduler;
|
||||
import org.codehaus.plexus.spring.PlexusToSpringUtils;
|
||||
import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
|
||||
|
@ -59,6 +61,12 @@ public class ArchivaStartup
|
|||
}
|
||||
}
|
||||
|
||||
public void contextDestroyed(ServletContextEvent contextEvent) {
|
||||
public void contextDestroyed(ServletContextEvent contextEvent)
|
||||
{
|
||||
ApplicationContext applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(contextEvent.getServletContext());
|
||||
if (applicationContext != null && applicationContext instanceof ClassPathXmlApplicationContext)
|
||||
{
|
||||
((ClassPathXmlApplicationContext)applicationContext).close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue