I am having an enterprise application which contains a WAR and EJB JAR modules. Both the modules make use of log4j logging. The WAR module makes use of Struts framework. So I kept the Struts related jar files in WEB-INF/lib and the libraries used by EJB JAR like log4j.jar, ibatis.jar, classes12.jar etc. in the EJB JAR file and added them to the Class-Path of the MANIFEST.MF of EJB JAR. Now when I deploy the EAR, the ActionServlet of Struts is throwing an exception saying that the org.apache.log4j.Layout class is not found. I have event used the class-loader delegate="true" in the sun-web.xml. From the web components like JSPs I am able to refer to classes mentioned in the Class-Path of EJB JAR. But I am not able to find out what is the problem with the "log4j.jar" and why only this file is giving problem. Can anyone please help?
Hello Nosaku, I found some reference in a SUN forum that says that SUN has a problem (bug) when using log4j. The way I solved it was putting the log4j.jar in the server's classpath EXPLICITLY. I hope this helps. Good luck.
I also had an issue with Log4j and placing it in the AS7 CLASSPATH didn't solve our issue. Where do you put the Log4J .properties file? AS7 needs to find it on start and can't. I've tried several different locations and it simply wouldn't find it.
I eventually had to remove it completely to stop AS7 from throwing exceptions.