I have a web application (WAR file) which uses jersey jars.Now when i am trying to deploy this i am getting class cast exception(Some bootstrap servlet uses jersey)..On analysis i found that weblogic itself have jersey jars in common\modules..and my web app have different version of jersey jars. Now if i delete the common/modules jersey jar then my web app got deployed.I want to know how can i make my web app to use its own version of jersey jars so that it gets deployed without deleting common/module jars.. PS my .war file don't have weblogic.xml and weblogic is generating it on the fly.
The typical first thing to try for something like this is to add a "prefer-web-inf-classes" element to your weblogic.xml file. See [http://docs.oracle.com/cd/E24329_01/web.1211/e21049/weblogic_xml.htm#WBAPP659] for more information.
David its already there...
but when i removed <prefer-web-inf-classes> element from web logic and added <prefer-application-packages> it worked fine..just want to know if there is any problem in 12c with <prefer-web-inf-classes> tag.
You should use prefer-application-packages when there is any conflict of classes specifically when the same class is being loaded by weblogic server.
When your using prefer-application-packages you should always set prefer-web-inf-classes to false.
This is documented please check following docs.