Jetty strives very hard to stop classloader pollution between contexts.
But then applications can often work very hard to defeat that effort... eg
if they pass an instance of an object via attributes of a cross context
dispatch.  Other issues can be caused if classes are put on the server path
and exposed to individual contexts.

So Jetty itself should definitely not reuse classloaders.  We go to great
efforts to flush out all loaded objects when a context is stopped, just to
stop the memory leak issues.  We definitely don't deliberately pass objects
or loaders between contexts.

So to work out what is going on, we need a better picture of your
classloaders, both for the server and all the contexts (a jetty server dump
would help with that).  But we also need to know if there is any cross
context dispatching going on, or any other communication between contexts?

regards







On Tue, 15 Feb 2022 at 00:28, Michael Klenk <mk-kl...@web.de> wrote:

> Hi Community,
>
>
> I've been experiencing weird classloading issues due to redeployment of
> a single WAR Application containing latest Jersey Framework.
>
> In the current setup I'm using Jetty 9.4.44 as Application Container to
> host webapplications on a Linux host. In the past I've restarted the
> Jetty process on Linux when I've deployed new applications. Recently
> I've tried to just redeploy the WAR file to the server and was getting
> ClassNotFound Exceptions from the Classloader.  A deeper analysis
> showed, that the Jersey class was still loaded from the former
> classloader instance of WebAppClassloader from a different context,
> which I expected to be deleted with the webapplication on unloading the
> context and redeploying the software without restarting the Jetty
> Process. It happened even if the former application was removed and the
> deployment of the WAR file happened minutes later in  a second step.
>
> Is this a known issue with Jetty, reusing unused classloader instances?
> Or is it a Bug with Jersey framework or Jetty Classloader isolation? How
> could an application force Jetty to share multiple WebAppClassLoader
> instances inside of one single context.
>
> Thank you in advance
>
>
> Michael
>
> _______________________________________________
> jetty-users mailing list
> jetty-users@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/jetty-users
>


-- 
Greg Wilkins <gr...@webtide.com> CTO http://webtide.com
_______________________________________________
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users

Reply via email to