• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using log4j in EAR module

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
tumbleweed and gunslinger
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic