commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mingfai" <ming...@hongkong.com>
Subject Re: [logging] Commons Logging with WebSphere
Date Thu, 06 Nov 2003 01:53:57 GMT
hi,

try to specify a system property as follows:

org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFac
toryImpl

In WSAD, there is an IBM log factory implementation:
com.ibm.ws.commons.logging.TrLogFactory by default. You may override it by
any ways such as using the above system properties or using PARENT_LAST in
class loader policy.

regards,
mingfai

----- Original Message ----- 
From: "Brian Lalor" <blalor@bravo5.org>
To: <commons-user@jakarta.apache.org>
Sent: Thursday, November 06, 2003 4:46 AM
Subject: Commons Logging with WebSphere


Good afternoon, all.  I'm attempting to use the Commons Logging API
with WebSphere Portal 5.0.  I'm getting a Log instance as shown in the
logging user's guide
private static Log log = LogFactory.getLog(CLASS.class);

This works fine in my development environment (WSAD on XP), but when I
try to deploy my portlet to a full-blown instance of Portal, my portlet
blows up.  The following is a snippet of the stack trace that occurs
when the portlet's being loaded.
biz.deltafaucet.contacts_list.ContactsListPortlet is my portlet:

[biz.deltafaucet.contacts_list.ContactsListPortlet]: Failed to load
servlet: java.lang.ExceptionInInitializerError:
org.apache.commons.logging.LogConfigurationException:
java.lang.ClassCastException: com.ibm.ws.commons.logging.TrLogFactory
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:609)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:561)
at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:352)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
at
biz.deltafaucet.contacts_list.ContactsListPortlet.<clinit>(ContactsListP
ortlet.java:45)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java(Compiled Code))
at java.beans.Beans.instantiate(Beans.java:233)

It looks like there may already be some of the commons logging
infrastructure built into WebSphere...

I'm assuming that I need to write a wrapper around the WebSphere
logging instance, but I'm hoping someone has already done that work.
:-)

Thanks,
B

--
    __   ____
   / /  / __/ Brian Lalor
  / _ \/__ \  blalor@bravo5.org
/_.__/____/  http://bravo5.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message