Because the SiteMinder WSS Agent for WebLogic implements logging using the Apache Commons Logging and Apache log4j packages, class loading problems can occur if protected web service applications also use the Commons Logging and log4j packages.
Symptom:
The SiteMinder WSS Agent for WebLogic uses the Apache Commons Logging package as part of its logging implementation. Class loading conflicts can occur when the SiteMinder WSS Agent is configured to protect web services that also use Commons Logging if the web service and SiteMinder WSS Agent are not using the same version of Commons Logging.
If such a class loading conflict is occurring, WebLogic may log an error output similar to the following during initialization:
<Sep 16, 2009 9:15:54 AM EDT> <Error> <HTTP> <BEA-101216> <Servlet: "ServicesServlethttp" failed to preload on startup in Web application: "XXXXXX.war". java.lang.ExceptionInInitializerError …. org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfig urationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.) (Caused by org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed. (Caused by org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.)) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:543) ….
Solution:
To remove class loading conflicts between the SiteMinder WSS Agent and protected web service, verify that the web service uses the same version of the Apache Commons Logging jar file (commons-logging.jar) as the SiteMinder WSS Agent (version 1.1.1). If the web service is not using the same version, replace the commons-logging.jar used by the web service with the 1.1.1 version.
Symptom:
The SiteMinder WSS Agent for WebLogic uses the Apache log4j package to produce logging output. This can lead to class loading and logging output conflict problems when the SiteMinder WSS Agent is configured to protect web services that also use the log4j package.
If such a conflict is occurring WebLogic logs error output similar to the following:
log4j:ERROR A "org.apache.log4j.DailyRollingFileAppender" object is not assignable to a "o rg.apache.log4j.Appender" variable. log4j:ERROR The class "org.apache.log4j.Appender" was loaded by log4j:ERROR [java.net.URLClassLoader@d8116d] whereas object of type log4j:ERROR "org.apache.log4j.DailyRollingFileAppender" was loaded by [weblogic.utils.clas sloaders.ChangeAwareClassLoader@10abd60 finder: weblogic.utils.classloaders.CodeGenClassFinder@5e33d4 annotation: StockTradeDemoDCC@StockTradeDemoDCC.war]. log4j:ERROR Could not instantiate appender named "CUSTOMER_APPENDER_NAME".
This error is caused by the web service class loader loading the specific Appender implementation class: DailyRollingFileAppender and the SiteMinder WSS Agent class loader loading the Appender interface class.
Solution:
Configure the system class loader to load the log4j jar instead of the SiteMinder WSS Agent and web service class loaders by adding log4j.jar to the JVM classpath.
Follow these steps:
For a WebLogic Server running as a command line application, make this change by editing the startWeblogic.cmd (Windows) or startWeblogic.sh (UNIX) script located in WLS_HOME/user_projects/domains/your_domain/bin.
log4j.category.com.netegrity.tm=DEBUG
log4j.category.com.netegrity.tm=DEBUG, A2
Copyright © 2015 CA Technologies.
All rights reserved.
|
|