Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-534

Improve error handling for situations where paths is null in findPossibleStaticLoggerBinderPathSet()

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 2.0.17
    • 1.7.32
    • Core API
    • None
    • JPMS/OSGi application

    • enhancement

    Description

      NPE in JPMS/OSGi application:

      Failed to instantiate SLF4J LoggerFactory
      Reported exception:
      java.lang.NullPointerException: Cannot invoke "java.util.Enumeration.hasMoreElements()" because "paths" is null
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.slf4j.LoggerFactory.findPossibleStaticLoggerBinderPathSet(LoggerFactory.java:310)
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.slf4j.LoggerFactory.bind(LoggerFactory.java:146)
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.ops4j.pax.logging.internal.Activator.start(Activator.java:112)
      	at org.apache.felix.framework@7.0.3/org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:849)
      	at org.apache.felix.framework@7.0.3/org.apache.felix.framework.Felix.activateBundle(Felix.java:2429)
      	at org.apache.felix.framework@7.0.3/org.apache.felix.framework.Felix.startBundle(Felix.java:2335)
      	at org.apache.felix.framework@7.0.3/org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
      	at org.apache.felix.framework@7.0.3/org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      	at java.base/java.lang.Thread.run(Thread.java:833)
      ERROR: Bundle org.ops4j.pax.logging.pax-logging-api [33] Error starting atomos:application:file:///[...]/de.bildschirmarbeiter.aem.toolbox.package/target/jlink/mp/pax-logging-api-2.0.15-SNAPSHOT.jar (org.osgi.framework.BundleException: Activator start error in bundle org.ops4j.pax.logging.pax-logging-api [33].)
      java.lang.IllegalStateException: Unexpected initialization failure
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.slf4j.LoggerFactory.bind(LoggerFactory.java:175)
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.ops4j.pax.logging.internal.Activator.start(Activator.java:112)
      	at org.apache.felix.framework@7.0.3/org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:849)
      	at org.apache.felix.framework@7.0.3/org.apache.felix.framework.Felix.activateBundle(Felix.java:2429)
      	at org.apache.felix.framework@7.0.3/org.apache.felix.framework.Felix.startBundle(Felix.java:2335)
      	at org.apache.felix.framework@7.0.3/org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
      	at org.apache.felix.framework@7.0.3/org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      	at java.base/java.lang.Thread.run(Thread.java:833)
      Caused by: java.lang.NullPointerException: Cannot invoke "java.util.Enumeration.hasMoreElements()" because "paths" is null
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.slf4j.LoggerFactory.findPossibleStaticLoggerBinderPathSet(LoggerFactory.java:310)
      	at ModuleConnectLoader-org.ops4j.pax.logging.pax-logging-api/org.ops4j.pax.logging.pax-logging-api@2.0.15.SNAPSHOT/org.slf4j.LoggerFactory.bind(LoggerFactory.java:146)
      	... 10 more
      

      Error should be more descriptive.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            olli Oliver Lietz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: