Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1876

Unreliable checking for runtime dependencies

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.2
    • Fix Version/s: 2.9.0
    • Component/s: Core
    • Labels:
      None

      Description

      If I include this in Maven POM:

      <dependency>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-databind</artifactId>
          <version>2.8.7</version>
          <scope>runtime</scope>
          <exclusions>
              <exclusion>
                  <groupId>com.fasterxml.jackson.core</groupId>
                  <artifactId>jackson-core</artifactId>
              </exclusion>
          </exclusions>
      </dependency>
      

      I get this printed on STDERR on startup:

      Unknown error checking for existence of class: com.fasterxml.jackson.databind.ObjectMapper
      java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/Versioned
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
      	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at java.lang.Class.forName0(Native Method)
      	at java.lang.Class.forName(Class.java:264)
      	at org.apache.logging.log4j.util.LoaderUtil.loadClass(LoaderUtil.java:141)
      	at org.apache.logging.log4j.util.LoaderUtil.isClassAvailable(LoaderUtil.java:115)
      	at org.apache.logging.log4j.core.util.Loader.isClassAvailable(Loader.java:310)
      	at org.apache.logging.log4j.core.config.yaml.YamlConfigurationFactory.<init>(YamlConfigurationFactory.java:47)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at org.apache.logging.log4j.core.util.ReflectionUtil.instantiate(ReflectionUtil.java:188)
      	at org.apache.logging.log4j.core.config.ConfigurationFactory.addFactory(ConfigurationFactory.java:190)
      	at org.apache.logging.log4j.core.config.ConfigurationFactory.getInstance(ConfigurationFactory.java:164)
      	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:613)
      	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:634)
      	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:229)
      	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:242)
      	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
      	at org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)
      	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:618)
      	at logtest.Main.<clinit>(Main.java:14)
      Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.Versioned
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	... 33 more
      Unknown error checking for existence of class: com.fasterxml.jackson.databind.ObjectMapper
      java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/Versioned
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
      	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at java.lang.Class.forName0(Native Method)
      	at java.lang.Class.forName(Class.java:264)
      	at org.apache.logging.log4j.util.LoaderUtil.loadClass(LoaderUtil.java:141)
      	at org.apache.logging.log4j.util.LoaderUtil.isClassAvailable(LoaderUtil.java:115)
      	at org.apache.logging.log4j.core.util.Loader.isClassAvailable(Loader.java:310)
      	at org.apache.logging.log4j.core.config.json.JsonConfigurationFactory.<init>(JsonConfigurationFactory.java:49)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      	at org.apache.logging.log4j.core.util.ReflectionUtil.instantiate(ReflectionUtil.java:188)
      	at org.apache.logging.log4j.core.config.ConfigurationFactory.addFactory(ConfigurationFactory.java:190)
      	at org.apache.logging.log4j.core.config.ConfigurationFactory.getInstance(ConfigurationFactory.java:164)
      	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:613)
      	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:634)
      	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:229)
      	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:242)
      	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
      	at org.apache.logging.log4j.LogManager.getContext(LogManager.java:174)
      	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:618)
      	at logtest.Main.<clinit>(Main.java:14)
      Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.Versioned
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	... 33 more
      

        Attachments

          Activity

            People

            • Assignee:
              mikaelstaldal Mikael Ståldal
              Reporter:
              mikaelstaldal Mikael Ståldal
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: