06-27-04 01:49 AM
Hi!
Lee Francis Wilhelmsen wrote:
> My portlet uses a few of the jakarta commons libraries. The one in
> question in this case is the Digester project (1.5). However, Digester
> is not the problem... it's the commons logging framework (1.0.3) that
> causing me headache.
>
> Now, I am not very familiar with the commons logging framework, since my
> portlet is using Log4J (1.2.8) for it's logging, but the Digester uses
> the commons logging framework so it needs to be in place.
>
> In my portlet I have a file in the WebContent/META-INF/services/
> directory named org.apache.commons.logging.LogFactory. It contains the
> line:
> org.apache.commons.logging.impl.Log4jFactory
> indicating that the commons logging framework should use Log4J classes
> for logging. However, WPS won't have nothing of it and says:
>
> Nested Exception is
> org.apache.commons.logging.LogConfigurationException:
> java.lang.ClassNotFoundException:
> com.ibm.wps.portlets.struts.logging.StrutsLogFactory
> 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:298)
> at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:414)
> at org.apache.commons.digester.Digester.<init>(Digester.java:346)
>
> when I try to initialize Digester.
>
> Now, where is com.ibm.wps.portlets.struts.logging.StrutsLogFactory
> coming from? This is a simple portlet and isn't using any kind of Struts
> references.
The JAR you're looking for is called "PortalStruts.jar". Include it in your
app. On Unix, go to the Portal Server directory and use "find . -name
PortalStruts.jar". I found it for instance in the IBM newsgroup portlet
directory.
There is an IBM article about Commons Logging and WebSphere:
http://www-1.ibm.com/support/docvie...uid=swg27004610
The main problem is that WebSphere ships with a version of Commons Logging
(and contains configuration settings) that typically is loaded before your
application. So the Commons Logging configuration included in your
application is probably ignored. The article describes how to fix that.
However, at least in the portal server, there still seem to be problems with
that approach because "something" wants to load the (IBM) StrutsLogFactory.
So you need to include it in your app. If you ever find out where this
StrutsLogFactory actually logs to - please tell me. :-)
> I'm using WSAD 5.1.0 with the local portlet envionment for development.
> Everything works fine on my machine. It's only when I move the portlet
> to the production WPS server that things go wrong.
>
> Any ideas?
>
> Regards
> Lee Francis
--
Karsten Silz
Seldon Systems, Inc.
www.seldonsystems.com
"Women often think about what other people think. Men don't even know that
other people think."
Dave Barry (http://www.davebarry.com)
[ Post a follow-up to this message ]
|