Monday Oct 07, 2013

Classloading errors in WebLogic Server

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"
http://docs.oracle.com/cd/E24329_01/web.1211/e24368/classloading.htm

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.
http://docs.oracle.com/cd/E24329_01/web.1211/e24368/classloading.htm#BABHJGJJ

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:
http://docs.oracle.com/cd/E24329_01/web.1211/e24368/classloading.htm#i1090543

3. Use FilteringClassLoader:

http://docs.oracle.com/cd/E24329_01/web.1211/e24368/classloading.htm#i1098467

Enjoy!

About


My name is Luz Mestre. I work as Principal Technical Support Engineer at Oracle Support. I'll post here the most interesting challenges I have in my daily work. The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

Search

Categories
Archives
« October 2013 »
SunMonTueWedThuFriSat
  
2
3
4
5
6
8
9
10
11
12
13
15
16
17
18
19
20
22
23
24
25
26
27
28
29
31
  
       
Today