class cast exception in weblogic

后端 未结 1 1815
太阳男子
太阳男子 2021-01-19 16:00

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 anal

相关标签:
1条回答
  • 2021-01-19 16:21

    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 to have this weblogic.xml in your war file and redeploy the application.

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

    prefer-web-inf-classes may not work all the time. If you are using a WebLogic version of 10.3.4+ then use remove prefer-web-inf-classes setting and use prefer-application-packages instead. Also go through this video on how classloading in WebLogic works.

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