Announcement Announcement Module
Collapse
No announcement yet.
NoSuchMethodError for org.apache.log4j.Logger.log Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NoSuchMethodError for org.apache.log4j.Logger.log

    Hi, i was configuring my spring application and when i was to deploy it this exception was thrown.

    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/web-data.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.log4j.Logger.log(Ljava/lang/String;Lorg/apache/log4j/Level;Ljava/lang/Object;Ljava/lang/Throwable


    I've cheked commons-logging (version 1.0.1) files, and in Notice it's written that this library needs log4j version 1.2.12. The problem is that i have this version, i've changed it even to 1.2.15, but this error still appear. (Yes i'd add log4j to libs)

  • #2
    According to this API, it looks like the method expects another argument containing the wrapper class' fully qualified class name.

    I'm guessing you're not calling this method directly, since it looks like it's coming from the sessionFactory. Could it be that you're missing either of the slf4j jars?

    slf4j-log4j12-1.5.0.jar
    slf4j-api-1.5.0.jar

    Comment


    • #3
      java.lang.NoSuchMethodError means wrong version, do you use maven or ant, check classpath you can have more than one log4j versions

      Comment


      • #4
        I was able to resolve this situation by adding jars:
        log4j
        slf4j-simple
        jcl-over-slf4j
        slf4j-api
        slf4j-log4j12

        In apropriate versions (see commons-logging.jar)

        Comment

        Working...
        X