facebook

log4j and tomcat problem

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #309486 Reply

    J. Braun
    Member

    I am having a problem adding log4j to my webapp. I have added the log4j jar file to my project as a user library.

    When I add the line:
    private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(“Logger.class”);

    I get the error:
    SEVERE: Error creating form bean of class com.akamai.struts.form.ConsoleForm
    java.lang.NoClassDefFoundError: org/apache/log4j/Logger
    at com.akamai.struts.form.ConsoleForm.<clinit>(ConsoleForm.java:26)

    If I comment out the line the app works fine. I have not gotten to an actual logger.debug(~) statement yet.

    What makes this especially maddening is that essentially the same code works fine as a straight java app but fails when run with tomcat. Any thoughts would be appreciated.

    #309491 Reply

    braunj,
    Can you clarify if “Jars from user libraries” is checked under Window > Preferences > MyEclipse > Java Enterprise Projects > Web Project > Deployment tab?
    If it is not selected, can you check the above option and try again?
    Let me know if that helps

    #309507 Reply

    J. Braun
    Member

    Yes, all the boxes are checked. Also, “Smart Deployment” is checked.

    #309520 Reply

    braunj,
    If you browse to the deployment location(from the servers view right click on your project and from the context menu select “Browse Deployment Location”), is the log4j jar file included under ~\WEB-INF\lib?
    Can you clarify if there are any project specific settings under Project > Properties > MyEclipse > Web > Deployment Tab?

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: log4j and tomcat problem

You must be logged in to post in the forum log in