@Override public void stop() throws LifecycleException { // in our destroyapplication method we need a valid classloader to TomcatWebAppBuilder.afterStop() if (forceStopPhase || restarting) { internalStop(); } }
public void internalDestroy() { try { if (!stopped) { try { internalStop(); } catch (final LifecycleException e) { // no-op } } super.destroy(); } finally { cleanUpClassLoader(); } }
@Override protected void startInternal() throws LifecycleException { if (getClassLoader() != null) { final TomEEWebappClassLoader webappClassLoader = TomEEWebappClassLoader.class.cast(getClassLoader()); if (webappClassLoader.isStopped()) { webappClassLoader.internalStop(); } } final Context context = getContext(); ClassLoaderConfigurer configurer = ClassLoaderUtil.configurer(context.getName()); // WEB-INF/jars.xml final File war = Contexts.warPath(Context.class.cast(context)); final File jarsXml = new File(war, "WEB-INF/" + QuickJarsTxtParser.FILE_NAME); final ClassLoaderConfigurer configurerTxt = QuickJarsTxtParser.parse(jarsXml); if (configurerTxt != null) { configurer = new CompositeClassLoaderConfigurer(configurer, configurerTxt); } TomEEWebappClassLoader.initContext(configurer); TomEEWebappClassLoader.initContext(context); try { super.startInternal(); } finally { TomEEWebappClassLoader.cleanContext(); } if (forceSkip != null && WebAppFirstEarClassLoader.class.isInstance(getClassLoader())) { WebAppFirstEarClassLoader.class.cast(getClassLoader()).setForceSkip(forceSkip.split(" *, *")); } }
if (destroyFromTomcat) { try { old.internalStop(); } catch (final LifecycleException e) { logger.error("error stopping classloader of webapp " + standardContext.getName(), e);