I have to use both (oddly enough ..) "prefer-web-inf-classes" and "prefer-application-packages properties of weblogic.xml on a Weblogic 12c Server (12.2.1)
It is REST application based on Jersey 1.9. * ( Jersey 1.x JAX-RS RI) and Guice.
1. Why use :prefer-web-inf-classes
If you have more than one WAR you have to place at the level of war/lib the libraries for guice-jersey / guice , other way you get an Multibindings Error.
It must be indicate also the prefer-web-inf-classes to true. This way works properly! I have tried to work in the same way using prefer-application-packages with packages (com.sun.jersey.guice.spi.container.servlet /com.google.inject.servlet, etc..) but no way.
Note: Is not possible to exclude this libraries at EAR level.
2. Why use :prefer-application-packages
To use Jersey 1.x JAX-RS RI on Weblogic 12c (12.2.1) so I have to indicate the following packages (other way Weblogic uses Jersey 2, and different version of Jackson libraries, etc. )
It works perfectly on Jersey 1.X if it is indicated this way. . I have probed two war separately, and works fine... but, remember my friend i have two war..so....
Summary
I can not use both properties (deploying error for using both properties on the weblogic.xml..), but its needed :
- For the problem with Guice Filter, need to put prefer-web-inf-classes to true to use guice-servlet.jar / jersey-guice.jar at war-lib level.
- To work with Jersey 1.x, need to use .....prefer-application-package
Question: How to combine both to use one of them??