Disclaimer

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Tuesday, August 2, 2011

Forcing weblogic server to pick project defined libraries

While building a web application using external jars you may frequently hit issues of having multiple jars containing different versions of same class in the class path and thus unable to run your app. In case of weblogic server you can always force the server to pick classes from your included libraries instead of from other places.
To do it just put the following lines in the weblogic.xml


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

In case weblogic.xml does not exist in your app then right click web project and click new. Go to deployment descriptors and choose weblogic.xml. This should generate a weblogic.xml file for you in case of jdeveloper.

No comments: