Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] About web application class loading (property setParentLoaderPriority)

Your question is confusing.

First, merely putting a jar in ${jetty.home}/lib/ does exactly bupkis, nothing, that jar is not on a classpath, classloader, or anything similar.

But that being said, you seem to have concerns about what WebAppContext.setParentLoaderPriority(boolean) does.

Default behavior is .setParentLoaderPriority(false)
This is the Default Servlet spec behavior.

"false" means that classes in the WebApp (WEB-INF/classes and WEB-INF/lib) will be tried first, then the ClassLoader.getParent() will be used.
"true" means that we use Standard Java ClassLoader behavior, where ClassLoader.getParent() is used first, then the WebApp.

That's all it means.

Note: The standard WebApp ClassLoader isolation and Container ClassLoader restrictions are still in place.


Joakim Erdfelt / joakim@xxxxxxxxxxx

On Tue, Sep 15, 2015 at 6:10 AM, Lupo Corrado <Corrado.Lupo@xxxxxxxxxx> wrote:
Hello, no feedback? Perhaps the question is not clear?

Thanks


-----Messaggio originale-----
Da: Lupo Corrado
Inviato: venerdì 11 settembre 2015 16:48
A: 'jetty-users@xxxxxxxxxxx'
Oggetto: About web application class loading (property setParentLoaderPriority)

Hello, I did not understood web application class loading (http://www.eclipse.org/jetty/documentation/current/jetty-classloading.html).

After reading the section "Controlling Webapp Classloader Priority", I'm confused.

The structure of my web application is:

myClass at WEB - INF/classes
library jar1-1.0.0.jar at jetty.home /lib contains class mypackage1.A

library jar1-2.0.0.jar at WEB - INF /lib contains class mypackage1.A

library jar2-1.0.0.jar at jetty.home / lib contains class mypackage2.B

Suppose I declare myClass and mypackage2.B like:

import mypackage2.B
public class myClass {

}
...


package mypackage2
import mypackage1.A
public class B {

}

If the property org.eclipse.jetty.webapp.WebAppContext.setParentLoaderPriority is set to false what happens when mypackage2.A is loaded?

It is loaded by jar1-2.0.0.jar ? or by jar1-1.0.0.jar ? or there is some ambiguity?

Thanks

Corrado
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top