In Websphere, I am trying to run JUnit Test on a Struts 1.1 application. When I ran the JUnit Test, I encounter the following exception:
java.lang.NoSuchMethodError: org.apache.log4j.Category: method log(Ljava/lang/String;Lorg/apache/log4j/Level;Ljava/lang/Object;Ljava/lang/Throwable;)V not found
The last line of our system's code that caused the exception is the following:
Log is created with the following line:
private final Log log = LogFactory.getLog(getClass());
This line of code appears in an abstract class. The LogFactory class here is org.apache.commons.logging.LogFactory.
Note that this code works perfectly fine when the application is started normally through Websphere, so I know this is an initialization problem. I have tried using MockStrutsTestCase and fiddling a little bit, but that did not work. Any help is appreciated. Thanks.