I have to use both (oddly enough ..) prefer-web-inf-classes
and prefer-application-packages
properties of weblogic.xml on a Weblogic
Hello, world! Hi, There are two way to resolve this problem.
You can used to combine both file in to one file and call it based on choose tag as requirements.
You can just write tags to merge or import/ include your xml file in to one. Example shown. Hint: Do google how to merge and call xml file based on condition.
After all
prefer-web-inf-classes
to true
.If you use this, you don't need to use prefer-application-packages
....BUT ENSURE that you have the correct libraries at war /ear level.
The problem was:
The Project had a dependency with Jersey 2 (based on Swagger for Jersey 2.X ...) So via Swagger dependencies (swagger-jersey2-jaxrs
), Jersey 2 libraries was packaged on ear/war... and so prefer-web-inf-classes
HAS NO EFFECT!
After removing the dependency all was resolved!
At same the level (classpath or ear lib, or war lib) should not exist different versions of the same library.