Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1487

Admin GUI of Payara 5.184 and 5.193 cannot be started with logback due to java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.2.3
    • None
    • None
    • Docker

    Description

      I´m trying to enable logback as slf4j binding by adding the following jars to
      /opt/payara/appserver/glassfish/domains/production/lib/ext:

      • slf4j-api-1.7.28.jar
      • log4j-over-slf4j-1.7.28.jar
      • logback-classic-1.2.3.jar
      • logback-core-1.2.3.jar

      When doing so, payaras´s admin UI cannot be started anymore due to java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer.

      When replacing the above libs against

      • slf4j-api-1.7.28.jar
      • log4j-over-slf4j-1.7.28.jar
      • slf4j-jdk14-1.7.28.jar

      payaras´s admin UI can be started now without any problems.

      (eventually related bugs: https://jira.qos.ch/browse/LOGBACK-1265 , https://jira.qos.ch/browse/LOGBACK-1419 )

      ----------------------------------------------------------------------------------------------------------------------
      Steps to reproduce:
      ----------------------------------------------------------------------------------------------------------------------

      Unpack attached zip file.

      cd A-payara-without-logback-ok
      docker build -t a-payara-without-logback-ok .
      docker run --rm -p 4848:4848 a-payara-without-logback-ok

      https://127.0.0.1:4848/

      --> OK (no logging related errors in payara log)

      cd B-payara-with-logback-failing
      docker build -t b-payara-with-logback-failing .
      docker run --rm -p 4848:4848 b-payara-with-logback-failing

      https://127.0.0.1:4848/

      --> FAILING with java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer

      Log:

      [#|2019-10-04T11:59:50.151+0000|INFO|Payara 5.184|javax.enterprise.system.core|_ThreadID=151;_ThreadName=Thread-26;_TimeMillis=1570190390151;_LevelValue=800;_MessageID=NCLS-CORE-00022;|
       Loading application __admingui done in 2,669 ms|#]
      
      [#|2019-10-04T11:59:50.272+0000|SEVERE|Payara 5.184|javax.enterprise.web.core|_ThreadID=151;_ThreadName=Thread-26;_TimeMillis=1570190390272;_LevelValue=1000;_MessageID=AS-WEB-CORE-00174;|
       Startup of context failed due to previous errors|#]
      
      [#|2019-10-04T11:59:50.275+0000|SEVERE|Payara 5.184|javax.enterprise.web.core|_ThreadID=151;_ThreadName=Thread-26;_TimeMillis=1570190390275;_LevelValue=1000;_MessageID=AS-WEB-CORE-00175;|
       Exception during cleanup after start failed
       org.apache.catalina.LifecycleException: Manager has not yet been started
       at org.apache.catalina.session.StandardManager.stop(StandardManager.java:868)
       at org.apache.catalina.core.StandardContext.stop(StandardContext.java:5927)
       at com.sun.enterprise.web.WebModule.stop(WebModule.java:647)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:5743)
       at com.sun.enterprise.web.WebModule.start(WebModule.java:618)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:956)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:939)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:684)
       at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2061)
       at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1706)
       at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
       at org.glassfish.internal.data.EngineRef.start(EngineRef.java:123)
       at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:294)
       at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:357)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.initialize(ApplicationLifecycle.java:542)
       at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:215)
       at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:102)
      |#]|
      
      [#|2019-10-04T11:59:50.276+0000|SEVERE|Payara 5.184|javax.enterprise.web.core|_ThreadID=151;_ThreadName=Thread-26;_TimeMillis=1570190390276;_LevelValue=1000;_MessageID=AS-WEB-CORE-00108;|
       ContainerBase.addChild: start:
       org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:5747)
       at com.sun.enterprise.web.WebModule.start(WebModule.java:618)
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:956)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:939)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:684)
       at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2061)
       at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1706)
       at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
       at org.glassfish.internal.data.EngineRef.start(EngineRef.java:123)
       at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:294)
       at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:357)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.initialize(ApplicationLifecycle.java:542)
       at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:215)
       at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:102)
       Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
       at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
       at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
       at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
       at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
       at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
       at com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.loadClass(APIClassLoaderServiceImpl.java:281)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
       at com.sun.enterprise.loader.CurrentBeforeParentClassLoader.loadClass(CurrentBeforeParentClassLoader.java:83)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
       at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1604)
       at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1505)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:348)
       at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
       at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
       at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
       at org.glassfish.web.loader.ServletContainerInitializerUtil.getInterestList(ServletContainerInitializerUtil.java:190)
       at org.apache.catalina.core.StandardContext.callServletContainerInitializers(StandardContext.java:5794)
       at com.sun.enterprise.web.WebModule.callServletContainerInitializers(WebModule.java:737)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:5722)
       ... 13 more
       Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContainerInitializer
       at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
       ... 41 more
      |#]|
      
      [#|2019-10-04T11:59:50.279+0000|WARNING|Payara 5.184|javax.enterprise.web|_ThreadID=151;_ThreadName=Thread-26;_TimeMillis=1570190390279;_LevelValue=900;|
       java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer
       java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer
       at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:960)
       at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:939)
       at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:684)
       at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2061)
       at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1706)
       at com.sun.enterprise.web.WebApplication.start(WebApplication.java:107)
       at org.glassfish.internal.data.EngineRef.start(EngineRef.java:123)
       at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:294)
       at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:357)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.initialize(ApplicationLifecycle.java:542)
       at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:215)
       at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:102)
      |#]|
      
      [#|2019-10-04T11:59:50.281+0000|SEVERE|Payara 5.184|javax.enterprise.system.tools.deployment.common|_ThreadID=151;_ThreadName=Thread-26;_TimeMillis=1570190390281;_LevelValue=1000;|
       Exception while invoking class com.sun.enterprise.web.WebApplication start method
       java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer
       at com.sun.enterprise.web.WebApplication.start(WebApplication.java:136)
       at org.glassfish.internal.data.EngineRef.start(EngineRef.java:123)
       at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:294)
       at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:357)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.initialize(ApplicationLifecycle.java:542)
       at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:215)
       at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:102)
      |#]|
      
      [#|2019-10-04T11:59:50.283+0000|SEVERE|Payara 5.184|javax.enterprise.system.core|_ThreadID=151;_ThreadName=Thread-26;_TimeMillis=1570190390283;_LevelValue=1000;_MessageID=NCLS-CORE-00026;|
       Exception during lifecycle processing
       java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer
       at com.sun.enterprise.web.WebApplication.start(WebApplication.java:136)
       at org.glassfish.internal.data.EngineRef.start(EngineRef.java:123)
       at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:294)
       at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:357)
       at com.sun.enterprise.v3.server.ApplicationLifecycle.initialize(ApplicationLifecycle.java:542)
       at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:215)
       at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:102)
      |#]|
      
      [#|2019-10-04T11:59:50.284+0000|SEVERE|Payara 5.184|javax.enterprise.system.core|_ThreadID=151;_ThreadName=Thread-26;_TimeMillis=1570190390284;_LevelValue=1000;|
       Exception while loading the app|#]
      
      [#|2019-10-04T11:59:50.285+0000|SEVERE|Payara 5.184|javax.enterprise.web|_ThreadID=151;_ThreadName=Thread-26;_TimeMillis=1570190390285;_LevelValue=1000;_MessageID=AS-WEB-GLUE-00192;|
       Undeployment failed for context |#]
      

      Attachments

        Activity

          People

            logback-dev Logback dev list
            christian.bulitta@kessler.ch Christian Bulitta
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: