Uploaded image for project: 'Spring for Apache Hadoop'
  1. Spring for Apache Hadoop
  2. SHDP-486

Don't bundle slf4j-log4j12

    XMLWordPrintable

    Details

      Description

      If my build.gradle has a boot starter compile dependency (ie. spring-boot-starter-integration) and spring-data-hadoop-test as a testCompile dependency by default there will be errors running tests with gradle because of multiple logging frameworks

      java.lang.IllegalStateException: Failed to load ApplicationContext
              Caused by:
              java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/Users/dx207/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-log4j12/1.7.5/6edffc576ce104ec769d954618764f39f0f0f10d/slf4j-log4j12-1.7.5.jar). If you are using Weblogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml Object of class [org.slf4j.impl.Log4jLoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext
      

      The work around is to exclude slf4j-log4j12

      testCompile ("org.springframework.data:spring-data-hadoop-test:2.1.0.RELEASE") {
              exclude group: "org.slf4j", module: "slf4j-log4j12"
              exclude group: "log4j", module: "log4j"
          }
      

        Attachments

          Activity

            People

            Assignee:
            thomas.risberg Thomas Risberg
            Reporter:
            dprotaso Dave Protasowski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified