Given a Spring 4.3.11-RELEASE web application with Jackson 2.8.10 deployed on WebLogic 12.2.2.1, we're running into issues because the Jackson version being loaded is the old one that is in the WLS oracle_common/modules
tree, which takes preference over other libraries.
We tried the following:
<prefer-application-packages>
<package-name>com.fasterxml.jackson.*</package-name>
</prefer-application-packages>
Running with the -verbose:class
flag clearly shows that the bad jars are being loaded:
[Loaded com.fasterxml.jackson.databind.type.ArrayType from file:/u01/oracle/oracle_common/modules/com.fasterxml.jackson.core.jackson-databind.jar]
lib
folderNothing worked.
Also, please note this is a shared WebLogic instance where we only have write access to the domain folder, so we can't do creative ideas like physically removing the offending legacy Jackson jars from the oracle_common folder, or messing with the patch_classpath or similar.
Any help greatly appreciated!
The problem was that the prefer-application-packages
directive was being put in the weblogic.xml inside a WAR package inside the EAR, and the classpath was not picking that in the right order:
foo-ear -> foo.war -> WEB-INF/weblogic.xml
We solved it by putting the directive at the EAR level:
foo-ear -> META-INF -> weblogic-application.xml
Now it's working correctly.