By lmestre on Oct 07, 2013
The root cause of a classloading issue is very simple. Either the required library is not being loaded by an application deployed in WLS or there is an incorrect invocation in an application deployed in WLS.
However, these errors can be very difficult to troubleshoot because they usually depend on customizations like:
1. OS Libraries.
2. Customized WebLogic Server classpath.
3. Application classpath.
4. Application Upgrade/Upgrade of an Oracle Product.
5. The issue occurs randomly.
There are several classloading issues you might be hitting, e.g: ClassCastException, NoClassDefFoundError, ClassNotFoundException, NoSuchMethodError.
The first document you need to check is "Understanding WebLogic Server Application Classloading"
The above document will help you to understand where you need to place your libraries and the configuration required depending on your needs.
How to Debug?
1. Add -verbose:class to JAVA_OPTIONS, this debug applies to any supported JVM.
2. Use wls-cat. This tool might provide suggestions to fix the issue experience.
By analyzing the logs you will see the specific jar and location where where are the classes being loaded from.
Logs are "very" verbose, but those contain the details on what is really going on.
Some common solutions...
1. Add a missed library (or version of a library) to the weblogic or Application classpath
2. Use prefer-web-inf-classes in weblogic.xml, e.g:
3. Use FilteringClassLoader: