3 Replies Latest reply on Aug 20, 2015 2:46 PM by jamezp

    Provider Log4jServletContainerInitializer not found

    theblur05

      I was hoping someone might be able to help me figure out this deployment error. I am using Jboss eap 6.2 and have a webservice that uses a library which has a log4j2 logger. This library uses log4j classes only available in the log4j 2.0-rc1 jars. During deployment of the war, the webservice creates and initializes this library, which in turn, initializes log4j. Immediately jboss throws the following exception:

       

      09:10:09,340 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."webservice.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."webservice.war".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment "webservice.war"

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]

          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]

          at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]

      Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider org.apache.logging.log4j.core.web.Log4jServletContainerInitializer not found

          at java.util.ServiceLoader.fail(ServiceLoader.java:239) [rt.jar:1.8.0_45]

          at java.util.ServiceLoader.access$300(ServiceLoader.java:185) [rt.jar:1.8.0_45]

          at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372) [rt.jar:1.8.0_45]

          at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) [rt.jar:1.8.0_45]

          at java.util.ServiceLoader$1.next(ServiceLoader.java:480) [rt.jar:1.8.0_45]

          at org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor.deploy(ServletContainerInitializerDeploymentProcessor.java:108)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          ... 5 more

       

      I have expanded the war and confirmed that the log4j-core and log4j-api jars are present, and org.apache.logging.log4j.core.web.Log4jServletContainerInitializer.class is present in the log4j-core jar. Does jboss require a later version of the log4j library? As far as I can tell, Log4jServletContainerInitializer isn't available in later releases of log4j.