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.
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 ]
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.
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
Joined: Feb 15, 2005
Thanks for posting your solution. Now hopefully someone running into the same problem can find the answer by searching this forum.