Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-6865

Class loader issue with Log4j in infinispan-embedded

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 8.2.3.Final
    • Core
    • None

      I would like to bring to your attention an issue with Log4j shadowing in infinispan-embedded.

      After a recent upgrade to Log4j 2.6 in our app where we have an infinispan-embedded dependency, we started getting occasional class loader exceptions. A quick inspection with JHades showed that the infinispan-embedded JAR includes a copy of Log4j, introduced by the shadow Maven plugin, but without rewriting the Log4j package names.

      Is there any specific reason to shadow Log4j like this?

      It also puzzles why we get this exception at all, since Log4j 2.x APIs should not change at all.

      {{5-Jul-2016 11:53:45.434 SEVERE [localhost-startStop-1]
      org.apache.catalina.core.ContainerBase.addChildInternal
      ContainerBase.addChild: start:
      org.apache.catalina.LifecycleException: Failed to start component
      [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/c2id]]
      at
      org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
      at
      org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
      at
      org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
      at
      org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
      at
      org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
      at
      org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1795)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
      Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
      Source)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NoSuchMethodError:
      org.apache.logging.log4j.status.StatusLogger.debug(Ljava/lang/String;Ljava/lang/Object;)V
      at
      org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:91)
      at
      org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
      Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
      Source)
      at
      sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at java.lang.Class.newInstance(Unknown Source)
      at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:93)
      at
      org.apache.logging.log4j.core.config.Configurator.getFactory(Configurator.java:45)
      at
      org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:157)
      at
      org.apache.logging.log4j.web.Log4jWebInitializerImpl.initializeNonJndi(Log4jWebInitializerImpl.java:168)
      at
      org.apache.logging.log4j.web.Log4jWebInitializerImpl.start(Log4jWebInitializerImpl.java:110)
      at
      org.apache.logging.log4j.web.Log4jServletContainerInitializer.onStartup(Log4jServletContainerInitializer.java:57)
      at
      org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5244)
      at
      org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      ... 10 more}}

              Unassigned Unassigned
              vladimir-2 Vladimir Dzhuvinov (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: