Weblogic 12c : Prefer-web-inf-classes and prefer-application-packages for Jersey

后端 未结 2 721
我寻月下人不归
我寻月下人不归 2021-01-18 04:26

I have to use both (oddly enough ..) prefer-web-inf-classes and prefer-application-packages properties of weblogic.xml on a Weblogic

相关标签:
2条回答
  • 2021-01-18 05:03
    • Hello, world! Hi, There are two way to resolve this problem.

      1. You can used to combine both file in to one file and call it based on choose tag as requirements.

      2. 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.

    0 讨论(0)
  • 2021-01-18 05:08

    After all

    1. Use just prefer-web-inf-classes to true.
    2. 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.

    0 讨论(0)
提交回复
热议问题