Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2787

log4j-core and log4j-api version mismatch can lead to very confusing errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.5.0
    • Infrastructure
    • None

    Description

      Daffodil libs do not explicitly depend on log4j-core, with the reason being that users can provide whatever log4j implementation that they want (maybe there's something else aside from log4j-core?)

      The problem with this is that if projects that depend on daffodil do not also depend on a log4j implementation then they get a warning like this:

      ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...

      For this reason, many schema projects add an explicit log4j-core dependency to suppress this warning. However, if the version of log4j-core they depend on does not match the version of log4j-api that Daffodil uses then you get a really verbose, unhelpful, and probably wrong, error message about classLoaderLayeringStrategy. And this is fairly common since we frequently update our dependencies but schema projects tend to lag behind.

      We need to either have a dependency on log4j-core so schema projects don't need to worry about adding this depend and matching versions, or use some other dependency mechanism to ensure whatever log4j implementation is used matches our log4j-api version.

      Attachments

        Activity

          People

            slawrence Steve Lawrence
            slawrence Steve Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: