Uploaded image for project: 'Pax Logging'
  1. PAXLOGGING-260

1.10.2 misses optional imports - breaks AsyncLogger

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 1.10.2
    • Fix versions: 1.10.3
    • Components: None
    • Labels:
    • Sprint:

      Description

      Version 1.10.2's manifest does not include a lot of optional imports anymore, e.g. com.lmax.disruptor.
      This leads to the logger breaking if e.g. Karaf gets configured for async logging log4j2.rootLogger.type = asyncRoot in logging config. Exception below.
      Note, that in the export-package, there still is the uses declaration for those missing optional imports.
      Adding the missing imports as they were in 1.10.1 fixes the issue and classes can get resolved again.

      Note that there are a lot

      CM Configuration Updater (ManagedService Update: pid=[org.ops4j.pax.logging]) ERROR Unable to invoke factory method in class class org.apache.logging.log4j.core.async.AsyncLoggerConfig$RootLogger for element AsyncRoot. java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:132)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:952)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:892)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:884)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:508)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:232)
              at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:244)
              at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545)
              at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261)
              at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.doUpdate(PaxLoggingServiceImpl.java:213)
              at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.updated(PaxLoggingServiceImpl.java:158)
              at org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl$1ManagedPaxLoggingService.updated(PaxLoggingServiceImpl.java:426)
              at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)
              at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)
              at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)
              at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1113)
              at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1069)
              at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138)
              at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105)
              at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.NoClassDefFoundError: com/lmax/disruptor/EventFactory
              at org.apache.logging.log4j.core.config.AbstractConfiguration.getAsyncLoggerConfigDelegate(AbstractConfiguration.java:202)
              at org.apache.logging.log4j.core.async.AsyncLoggerConfig.<init>(AsyncLoggerConfig.java:82)
              at org.apache.logging.log4j.core.async.AsyncLoggerConfig$RootLogger.createLogger(AsyncLoggerConfig.java:227)
              ... 24 more
      Caused by: java.lang.ClassNotFoundException: com.lmax.disruptor.EventFactory not found by org.ops4j.pax.logging.pax-logging-log4j2 [7]
              at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639)
              at org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
              at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
              ... 27 more
      
      CM Configuration Updater (ManagedService Update: pid=[org.ops4j.pax.logging]) ERROR Null object returned for AsyncRoot in Loggers.
      

      If you compare 1.10.2 to 1.10.1 those optional imports were removed (does not mean all of them by accident, but at least the ones declared as used are missing):

       com.beust.jcommander.validators;resolution:=optional
       com.beust.jcommander;resolution:=optional
       com.conversantmedia.util.concurrent;resolution:=optional
       com.fasterxml.jackson.annotation;resolution:=optional
       com.fasterxml.jackson.core.type;resolution:=optional
       com.fasterxml.jackson.core.util;resolution:=optional
       com.fasterxml.jackson.core;resolution:=optional
       com.fasterxml.jackson.databind.annotation;resolution:=optional
       com.fasterxml.jackson.databind.deser.std;resolution:=optional
       com.fasterxml.jackson.databind.module;resolution:=optional
       com.fasterxml.jackson.databind.node;resolution:=optional
       com.fasterxml.jackson.databind.ser.impl;resolution:=optional
       com.fasterxml.jackson.databind.ser.std;resolution:=optional
       com.fasterxml.jackson.databind.ser;resolution:=optional
       com.fasterxml.jackson.databind;resolution:=optional
       com.fasterxml.jackson.dataformat.xml.annotation;resolution:=optional
       com.fasterxml.jackson.dataformat.xml.util;resolution:=optional
       com.fasterxml.jackson.dataformat.xml;resolution:=optional
       com.fasterxml.jackson.dataformat.yaml;resolution:=optional
       com.lmax.disruptor.dsl;resolution:=optional
       com.lmax.disruptor;resolution:=optional
       javax.activation;resolution:=optional
       javax.annotation.processing;resolution:=optional
       javax.crypto;resolution:=optional
       javax.jms;resolution:=optional
       javax.lang.model.element;resolution:=optional
       javax.lang.model.util;resolution:=optional
       javax.lang.model;resolution:=optional
       javax.mail.internet;resolution:=optional
       javax.mail.util;resolution:=optional
       javax.mail;resolution:=optional
       javax.management;resolution:=optional
       javax.naming;resolution:=optional
       javax.net.ssl;resolution:=optional
       javax.net;resolution:=optional
       javax.persistence;resolution:=optional
       javax.script;resolution:=optional
       javax.sql;resolution:=optional
       javax.tools;resolution:=optional
       
       org.apache.commons.compress.compressors;resolution:=optional
       org.apache.commons.compress.utils;resolution:=optional
       org.apache.commons.csv;resolution:=optional
       org.apache.kafka.clients.producer;resolution:=optional
       
       org.codehaus.stax2;resolution:=optional
       org.fusesource.jansi;resolution:=optional
       org.jctools.queues;resolution:=optional
       
       org.zeromq;resolution:=optional
      

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                jbonofre Jean-Baptiste Onofre
                Reporter:
                mreasy Rico Neubauer
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: