Weblogic configuration - prefer-web-inf-classes

prefer-web-inf-classes must be specified for classes specified in Web-INF in order to accept predictability over the classes present in the weblogic server application library. I have a special case when I need a class loader to use one specific jar from the WEB-INF folder. Is there any way to do this?

+4
source share
3 answers

Can you see the Filtering Classloaders ?

This allows you to specify at the package level individually which class the loader should use.

You want to be very careful with this. Are you sure that you are already in the Class add-on, so you should resort to such things, and there is no alternative?

Do you think the JAR is located in the APP-INF/lib folder of your EAR? Or move "everything except what you need in WEB-INF / lib" to APP-INF / lib?

+2
source

If you are using Weblogic version 10.3.4+. You can use prefer-application-packages to control loading preferences at the class level. Watch this video for more details.

+1
source

Prefer that all packages located in your WEB-INF / lib compared to those associated with your WebLogic lib set <prefer-web-inf-classes> are true in your weblogic.xml or application-weblogic.xml .

 <container-descriptor> <prefer-web-inf-classes>true</prefer-web-inf-classes> </container-descriptor> 

For more information, see Using Classloader Filters, weblogic.xml Deployment Descriptor Elements and WebLogic ClassLoaders, ClassLoader Filter, and ClassLoader Analysis Tool.

If you are not sure if the correct class is loaded, you can use the Classloader loader analysis tool for WebLogic.

+1
source

Source: https://habr.com/ru/post/1381672/


All Articles