Problem:
- Product Name : AppServer
- Product Version : 6.5 and Above
- Platform/OS Version : ALL
In order to troubleshoot classloading problems your application, you will need to know the exact class loading and the corresponding jars to understand from which the exception is thrown.
Resolution:
1). Add the below entries as a VM property in the partition_server.config.
The config file is located in the below folder:
<appserver-install>\\var\\domains\\base\\configurations\\<configuration_name>\\mos\\<partition_name>\\adm\\properties
"vmprop ClassLoaderDebug=true"
"vmparam -verbose:class"
2). Add the following entries into the logConfiguration.xml.
The xml config file is located in the below folder:
<appserver-install>\\var\\domains\\base\\configurations\\<configuration_name>\\mos\\<partition_name>\\adm\\properties
3). When you enable "vmparam -verbose:class", you can see the class loading and corresponding .jars in the stdout logs. For example :
[Loaded com.borland.security.jacc.VisiPolicyContextHandler from file:/C:/Borland/BAS6.7_Tibco/lib/asrt.jar]
[Loaded com.borland.security.jacc.HttpServletRequestPolicyContextHandler from file:/C:/Borland/BAS6.7_Tibco/lib/asrt.jar]
[Loaded com.borland.security.jacc.provider.BESPolicyConfiguration from file:/C:/Borland/BAS6.7_Tibco/lib/asrt.jar]
4). When you enable "vmprop ClassLoaderDebug=true" and add the entries into the logConfiguration.xml, you can see the debug statements related to the classloader in the Partition log.
For example:
2009-06-26 13:28:21,977 DEBUG - *cld* loadClass: searching local repositories
2009-06-26 13:28:21,977 DEBUG - *cld* findClass: find class org.apache.commons.discovery.resource.names.ResourceNameDiscoverImpl
2009-06-26 13:28:21,977 DEBUG - *cld* findResourceInternal: attempting to find org/apache/commons/discovery/resource/names/ResourceNameDiscoverImpl.class
2009-06-26 13:28:21,977 DEBUG - *cld* findResourceInternal: attempting to find org/apache/commons/discovery/resource/names/ResourceNameDiscoverImpl.class using reader bjchannel.war
2009-06-26 13:28:21,977 DEBUG - *cld* findResourceInternal: attempting to find org/apache/commons/discovery/resource/names/ResourceNameDiscoverImpl.class using reader WEB-INF/lib/activation.jar
2009-06-26 13:28:21,977 DEBUG - *cld* findResourceInternal: attempting to find org/apache/commons/discovery/resource/names/ResourceNameDiscoverImpl.class using reader WEB-INF/lib/ai-bce-core-2.0.jar
2009-06-26 13:28:21,977 DEBUG - *cld* findResourceInternal: attempting to find org/apache/commons/discovery/resource/names/ResourceNameDiscoverImpl.class using reader WEB-INF/lib/antlr-runtime-3.0.jar
5). The detailed logs are stored in Partition and stdout logs.
These logs are located in the below folder:
<appserver-install>\\var\\domains\\base\\configurations\\<configuration_name>\\mos\\<partition_name>\\adm\\logs
6). Command-line options for Trace loading and unloading of classes using the below debugging options
(i) -XX-TraceClassLoading
(ii) -XX-TraceClassUnloading
For more information , Please refer the below url http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
#Security
#AppServer
#VisiBroker
#debugging
#classloader