1

I know that there are hundreds of post about wls:prefer-web-inf-classes but I still having some doubts about how it works.

If I have an application that relies on another lib:

- my-app.war  ---
                 |
- libs.war  < ---  

If I set wls:prefer-web-inf-classes to true Weblogic classloader prefers my my-app.war libraries but not classes in libs.war, right?

According to the [docs](By default, this element is set to False. Setting this element to True subverts the classloader delegation model so that class definitions from the Web application are loaded in preference to class definitions in higher-level classloaders. This allows a Web application to use its own version of a third-party class, which might also be part of WebLogic Server. See weblogic.xml Deployment Descriptor Elements.)

By default, this element is set to False. Setting this element to True subverts the classloader delegation model so that class definitions from the Web application are loaded in preference to class definitions in higher-level classloaders. This allows a Web application to use its own version of a third-party class, which might also be part of WebLogic Server. See weblogic.xml Deployment Descriptor Elements.

The element, if set to true, will cause classes located in the WEB-INF directory of a Web application to be loaded in preference to classes loaded in the application or system classloader. The default value is false. A value specified in the console will take precedence over a value set manually.

Jose A. Matarán
  • 1,044
  • 3
  • 13
  • 33
  • 2
    Classes from libs.war are not "visible" from your web app (my-app.war) because theuy won't be located in the application CLASSPATH. So, setting prefer-web-inf-classes to True won't have any impact. It will have an impact when the classloader will find a class from the server's classpath and also in your web app's classpath. In this situation it will choose your application. – Emmanuel Collin Sep 24 '22 at 10:26

0 Answers0