Hi Mark,
Sorry for the ambiguous 'unload' language, I suppose the tomcat language
would be 'context stop'.  The issue occurs when deploying the WAR using the
Tomcat Manager interface (*not *by dropping the WAR in /webapps).

You should be able to reproduce the issue with these steps:

   1. Build the ClassNotFoundGenerator WAR from
   https://github.com/austinjones/ClassNotFoundGenerator/
   2. Make this HTTP request to the Tomcat Manager:
    
/manager/text/deploy?war=path/to/ClassNotFoundGenerator.war&version=&config=path/to/context.xml&path=/ClassNotFoundGenerator&update=true
   3. After the application is fully deployed, make the HTTP request again.

   4. The TestcaseContextListener.contextDestroyed handler fires.  The
   ClassNotFoundError is caught by Tomcat, and logged to localhost.log.

Thank you for your help on this!  Let me know if I can clarify any further.

On Mon, Mar 23, 2015 at 12:50 AM, Mark Thomas <ma...@apache.org> wrote:
>
> It isn't clear (yet) that there is a problem.
>
> > Should the ClassLoader fall back to the
> > compressed WAR?  Should the DocBase be deleted after the context is
> stopped?
>
> The subject uses "unload". That concept is not one used in the Tomcat
> docs or code.
>
> You stated in your first message that autoDeploy was disabled.
>
> It isn't clear what the "unload" is, what is triggering it and what
> changes (if any) you have made to either the WAR or the exploded
> directory. Some details on what is triggering this issue would go a long
> way to helping figuring out what is going on and if there is a bug here
> or not.
>
> Mark
>
> >
> > On Sun, Mar 22, 2015 at 2:26 PM, Austin Jones <a...@avadynehealth.com>
> wrote:
> >
> >> I was able to reproduce the issue in a simple testcase application:
> >> https://github.com/austinjones/ClassNotFoundGenerator/
> >>
> >> On Sun, Mar 22, 2015 at 1:45 PM, Austin Jones <a...@avadynehealth.com>
> >> wrote:
> >>
> >>> I put 8.0.20 on a testing machine, and saw the same issue.
> >>>
> >>> On Sun, Mar 22, 2015 at 12:15 PM, Christopher Schultz <
> >>> ch...@christopherschultz.net> wrote:
> >>>
> > Austin,
> >
> > On 3/21/15 6:19 PM, Austin Jones wrote:
> >>>>>> I'm having an issue with Tomcat 8.0.12 when undeploying contexts.
> >>>>>> I have autoDeploy turned off, and am pushing WARs+context.xmls
> >>>>>> through the Tomcat manager's deploy command.
> >>>>>>
> >>>>>> I have several ServletContextListeners that handle proper context
> >>>>>> shutdown.  The ones that cause the issue look like this:
> >>>>>>
> >>>>>> @Override public synchronized void contextInitialized(
> >>>>>> ServletContextEvent event ) { if( enabled ) {
> >>>>>> MyClass.initialize(); } }
> >>>>>>
> >>>>>> @Override public synchronized void contextDestroyed(
> >>>>>> ServletContextEvent event ) { MyClass.release(); }
> >>>>>>
> >>>>>> If the 'enabled' flag is not set, and MyClass was not loaded
> >>>>>> anywhere else in the app, the webapp ClassLoader tries to load the
> >>>>>> class while the context is shutting down.  It throws this
> >>>>>> exception: java.lang.NoClassDefFoundError: some/package/MyClass at
> >>>>>> some.package.MyListener.contextDestroyed(SingletonCleaner.java:na)
> >>>>>> at
> >>>>>>
> >
> org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4792)
> >>>>>>
> >>>>>>
> > at
> >>>>>>
> >
> org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5392)
> >>>>>>
> >>>>>>
> > at
> >>>>>> org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
> >>>>>>
> >>>>>>
> > at
> >>>>>>
> >
> org.apache.catalina.core.StandardContext.reload(StandardContext.java:3768)
> >>>>>>
> >>>>>>
> > at
> >>>>>> org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1306)
> >>>>>>
> >>>>>>
> > at
> >>>>>>
> >
> org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1238)
> >>>>>>
> >>>>>>
> > at
> >>>>>> org.apache.catalina.startup.HostConfig.check(HostConfig.java:1493)
> >>>>>> at sun.reflect.GeneratedMethodAccessor574.invoke(Unknown Source)
> >>>>>> at
> >>>>>>
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >>>>>>
> >>>>>>
> > at java.lang.reflect.Method.invoke(Method.java:483)
> >>>>>> at
> >>>>>>
> >
> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
> >>>>>>
> >>>>>>
> > at
> >>>>>>
> >
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
> >>>>>>
> >>>>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> >>>> For additional commands, e-mail: users-h...@tomcat.apache.org
> >>>>
> >>>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>

Reply via email to