Cast class exception in weblogic

I have a web application (WAR file) that uses jars.Now jersey, when I try to deploy this I get a class exception (Some bootstrap servlet uses jersey). In the analysis, I found that the weblogic itself has jersey jars in the common \ modules..and my web application has a different version of jersey jars. Now, if I remove the generic / jersey jar js, then my web application will be deployed. I want to know how I can get my web application to use its own version of jersey jars so that it unfolds without removing the regular / modular jars. PS my .war file does not have weblogic.xml and weblogic generates it on the fly.

+4
source share
1 answer

Get the weblogic.xml generated on the fly by WebLogic and modify it to add:

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

Now make sure that this weblogic.xml file is in your military file and redeploy the application.

Setting prefer-web-inf-classes to true will give preference to the classes present in the WEB-INF directory of the application.

prefer-web-inf-classes may not work all the time. If you are using WebLogic version 10.3.4+, use the prefer-web-inf-classes setting and use prefer-application-packages instead, Also watch this video on how class loading in WebLogic works.

+5
source

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


All Articles