WebSphere Application Server - WAS 5.0 and jakarata commons-logging issue

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > March 2006 > WAS 5.0 and jakarata commons-logging issue





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author WAS 5.0 and jakarata commons-logging issue
Joesph Matthew

2006-03-06, 5:55 pm

Hi,
I am trying to create a HttpClient Object (from Jakarata Commons)
inside WAS 5.0. I am getting the following exception

ExceptionInInitializerError
occured=java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
.....
..... (My code's stack trace)
.....
Caused by: org.apache.commons.logging.LogConfigurationException:
java.lang.InstantiationException (Caused by
java.lang.InstantiationException)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:579)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:517)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:308)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:65)
... 32 more
Caused by: java.lang.InstantiationException
at sun.reflect. InstantiationExceptionConstructorAccesso
rImpl. newInstance(Insta_ntiationExceptionConst
ructorAccessorImpl.java:30)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:531)
... 37 more


I am using Commons-logging, along with commons-httpclient-3.0-beta1 and
log4j-1.2.7.


I have added commons-logging.properties to the commons-logging.jar. The
property file has the following two lines
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.Log4j_Factory
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger


All the above 3 jars are present in the WAR/WEB-INF/lib directory. The
class loader policy has been set to as described below

Application class loading mode = PARENT_LAST
Application classloader policy = Multiple
Enterprise Application Classloader Mode = PARENT_LAST
WAR Classloader Policy = APPLICATION


Can anybody shed any light on why i am getting this exception? And how
do I resolve it ?


Thanks in Advance

2006-03-17, 2:59 am

Here's a couple of links that might be useful:

http://wiki.apache.org/jakarta-comm...yAskedQuestions

This one points to a 20 pages pdf describing various scenarios:
http://www-1.ibm.com/support/docvie...uid=swg27004610

For more details about the issues with JCL:

http://www.qos.ch/logging/classloader.jsp
http://www.qos.ch/logging/thinkAgain.jsp

What worked for me is to have:
Application class loading mode = PARENT_LAST
Application classloader policy = Multiple
WAR Classloader Policy = APPLICATION
*** also check this one -> Web module class loading mode = PARENT_FIRST

Hope this helps.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com