• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

WAS 5.1 using Struts 1.2.9 - commons-logging issue

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
has anyone gotten WAS 5.1 + Struts 1.2.9 working together?

I'm getting bit (I think) by WAS's forced loading of the commons-logging.jar:

Caused by: org.apache.commons.logging.LogConfigurationException:
The chosen LogFactory implementation does not extend LogFactory.
Please check your configuration.
(Caused by java.lang.ClassCastException:
com.ibm.ws.commons.logging.TrLogFactory)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:574)

I fear this older version of WAS has a different version of the commons-logging.jar that struts 1.2.9 was built against.

I have the log4J jar in the EAR also. Is there some way I can tell the commons-logging used inside the WAS container (that I have no control over?) to use a specified LOG4J factory.

Jason


Caused by: org.apache.commons.logging.LogConfigurationException: The chosen LogFactory implementation does not extend LogFactory. Please check your configuration. (Caused by java.lang.ClassCastException: com.ibm.ws.commons.logging.TrLogFactory)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:574)
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 at org.apache.struts.util.MessageResources.<clinit>(MessageResources.java:57).null(Unknown Source)
... 40 more
Caused by: java.lang.ClassCastException: com.ibm.ws.commons.logging.TrLogFactory
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:531)
[ June 19, 2006: Message edited by: Jason Berk ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jason,

I'm afraid I'm not much help here. My client also uses WebSphere Application Server Version 5.1.2, but their policy is that all applications have to be built to use Struts 1.1, so they don't have this issue.

You might be able to get around the issue, though, by just using the log4j API in your applications and avoiding the use of commons.logging APIs.
 
Jason Berk
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Merrill,

http://jakarta.apache.org/commons/logging/troubleshooting.html


Some containers use a custom LogFactory implementation to adapt JCL to their particular logging system. This has some important consequences for the deployment of applications using JCL within these containers.

Containers known to use this mechanism:
* WebSphere Application Server from IBM (versions 5 and 6).


If you want to continue to use the default container mechanism then:
* Find and replace the commons-logging implementation used by the container with the most modern release
(NOT POSSIBLE FOR BUSINESS REASONS)

* Replace the commons-logging jar in the application with the commons-logging-adapters jar. This will ensure that application classloader will delegate to it's parent when loading LogFactory.
(WORKED LIKE A CHAMP)


only hitch is that we had to rename "commons-logging-adapters.jar" to
"commons-logging.jar" to match the struts.jar manifest.

Now I have WARs using struts 1.2.9 running on WAS5.1

jason
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jason,

Thanks for posting your solution. Now hopefully someone running into the same problem can find the answer by searching this forum.

Merrill
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A test environment update also fixes the problem. There is a fix pack available on the IBM website (V6.0.2.5)

Cheers
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic