Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-498

repositories example throws NoSuchMethodError due to conflicting log4j versions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 0.6
    • 0.6
    • Examples
    • None

      When launching the repositories example (using run.sh from target/dna-example-repositories-basic.dir/) I immediately get the following error:

      Exception in thread "Thread-1" java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()Z
      at org.slf4j.impl.Log4jLoggerAdapter.isTraceEnabled(Log4jLoggerAdapter.java:81)
      at org.jboss.dna.common.util.Logger.isTraceEnabled(Logger.java:411)
      at org.jboss.dna.graph.connector.map.MapRepositoryConnection.execute(MapRepositoryConnection.java
      etc...

      This is due to the lib direcotry containing both log4j-1.2.14.jar and log4j-1.2.8.jar. 1.2.14 is the correct one and contains the isTraceEnabled method, but version 1.2.8 is the one being used at runtime.

      "mvn dependency:tree" shows the following dependendy paths to log4j:

      [INFO] +- log4j:log4j:jar:1.2.14:compile
      [INFO] +- org.jboss.security:jbosssx-bare:jar:2.0.2.SP6:compile
      [INFO] | +- org.jboss.security:jboss-security-acl-impl:jar:2.0.2.SP6:compile
      [INFO] | | +- jboss:jboss-logging-log4j:jar:2.0.2.GA:runtime
      [INFO] | | | - apache-log4j:log4j:jar:1.2.8:runtime

            rhauch Randall Hauch (Inactive)
            torkjel_jira torkjel hongve (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: