title: Karaf bundle using ch.qos.logback , log4j org/apache/logging/log4j/util/ReflectionUtil
body: <p>I have an osgi 6.0.0 project which uses logback and slf4j.</p>
  
  <p>Currently I am implementing a bundle which depends on an external jar which uses
  org.apache.logging.log4j</p>
  
  <p>during the command line execution the bundle my karaf console freezes by displaying this error : </p>
  
  <p>Exception in thread "Karaf local console user karaf" java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/ReflectionUtil
      at org.apache.logging.log4j.core.impl.ThrowableProxy.(ThrowableProxy.java:145)
      at org.apache.logging.log4j.core.impl.ThrowableProxy.(ThrowableProxy.java:125)
      at org.apache.logging.log4j.core.impl.MutableLogEvent.getThrownProxy(MutableLogEvent.java:338)
      at org.ops4j.pax.logging.log4j2.internal.PaxLoggingEventImpl.getThrowableStrRep(PaxLoggingEventImpl.java:76)
      at org.apache.karaf.log.core.internal.KarafLogEvent.(KarafLogEvent.java:45)
      at org.apache.karaf.log.core.internal.LogServiceImpl.doAppend(LogServiceImpl.java:177)
      at org.ops4j.pax.logging.log4j2.internal.PaxAppenderProxy.doAppend(PaxAppenderProxy.java:65)
      at org.ops4j.pax.logging.log4j2.appender.PaxOsgiAppender.append(PaxOsgiAppender.java:82)
      at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
      at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:448)
      at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:433)
      at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:417)
      at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:403)
      at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63)
      at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:146)
      at org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.doLog0(PaxLoggerImpl.java:151)
      at org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.doLog(PaxLoggerImpl.java:144)
      at org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.error(PaxLoggerImpl.java:192)
      at org.ops4j.pax.logging.internal.TrackingLogger.error(TrackingLogger.java:96)
      at org.ops4j.pax.logging.slf4j.Slf4jLogger.error(Slf4jLogger.java:953)
      at org.apache.karaf.shell.support.ShellUtil.logException(ShellUtil.java:152)
      at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.doExecute(ConsoleSessionImpl.java:474)
      at org.apache.karaf.shell.impl.console.ConsoleSessionImpl.run(ConsoleSessionImpl.java:407)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.util.ReflectionUtil not found by org.apache.logging.log4j.api [112]
      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)
      at org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1414)
      at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1660)
      at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1590)
      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</p>