Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8329013

StackOverflowError when starting Apache Tomcat with signed jar

    XMLWordPrintable

Details

    Backports

      Description

        ADDITIONAL SYSTEM INFORMATION :
        OS: Windows or Linux
        JRE: 1.8.381 or later, 17.0.10
        Apache Tomcat 9.0.82

        A DESCRIPTION OF THE PROBLEM :
        Apache Tomcat does not start when there is a signed jar in $TOMCAT_HOME/lib folder with logginig.properties file inside.
        It fails with StackOverflowError.
        Looks like https://bugs.openjdk.org/browse/JDK-8314263 is still here.

        REGRESSION : Last worked in version 17

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        1. Deploy Apache Tomcat 9.0.82
        2. Create a signed jar with logging.properties file inside.
        3. Put the jar from step 2 in $TOMCAT_HOME/lib folder
        4. Start server with $TOMCAT_HOME/bin/startup.sh

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Apache Tomcat successfuly starts.
        ACTUAL -
        Stacktrace from Java 8:

        org.apache.catalina.startup.Bootstrap main
        SEVERE: Init exception
        java.lang.StackOverflowError
                at java.lang.String.startsWith(Unknown Source)
                at java.net.URL.isBuiltinStreamHandler(Unknown Source)
                at java.net.URL.isBuiltinStreamHandler(Unknown Source)
                at java.net.URLStreamHandler.setURL(Unknown Source)
                at java.net.URLStreamHandler.parseURL(Unknown Source)
                at sun.net.www.protocol.file.Handler.parseURL(Unknown Source)
                at java.net.URL.<init>(Unknown Source)
                at java.net.URL.<init>(Unknown Source)
                at sun.misc.URLClassPath$FileLoader.getResource(Unknown Source)
                at sun.misc.URLClassPath$FileLoader.findResource(Unknown Source)
                at sun.misc.URLClassPath.findResource(Unknown Source)
                at java.net.URLClassLoader$2.run(Unknown Source)
                at java.net.URLClassLoader$2.run(Unknown Source)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.net.URLClassLoader.findResource(Unknown Source)
                at java.lang.ClassLoader.getResource(Unknown Source)
                at java.net.URLClassLoader.getResourceAsStream(Unknown Source)
                at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:433)
                at org.apache.juli.ClassLoaderLogManager.lambda$getClassLoaderInfo$2(ClassLoaderLogManager.java:395)
                at java.security.AccessController.doPrivileged(Native Method)
                at org.apache.juli.ClassLoaderLogManager.getClassLoaderInfo(ClassLoaderLogManager.java:393)
                at org.apache.juli.ClassLoaderLogManager.addLogger(ClassLoaderLogManager.java:142)
                at java.util.logging.LogManager.demandSystemLogger(Unknown Source)
                at java.util.logging.Logger.getPlatformLogger(Unknown Source)
                at java.util.logging.LoggingProxyImpl.getLogger(Unknown Source)
                at sun.util.logging.LoggingSupport.getLogger(Unknown Source)
                at sun.util.logging.PlatformLogger$JavaLoggerProxy.<init>(Unknown Source)
                at sun.util.logging.PlatformLogger$JavaLoggerProxy.<init>(Unknown Source)
                at sun.util.logging.PlatformLogger.<init>(Unknown Source)
                at sun.util.logging.PlatformLogger.getLogger(Unknown Source)
                at jdk.internal.event.EventHelper.isLoggingSecurity(Unknown Source)
                at sun.security.jca.JCAUtil.tryCommitCertEvent(Unknown Source)
                at java.security.cert.CertificateFactory.generateCertificate(Unknown Source)
                at sun.security.pkcs.PKCS7.parseSignedData(Unknown Source)
                at sun.security.pkcs.PKCS7.parse(Unknown Source)
                at sun.security.pkcs.PKCS7.parse(Unknown Source)
                at sun.security.pkcs.PKCS7.<init>(Unknown Source)
                at sun.security.util.SignatureFileVerifier.<init>(Unknown Source)
                at java.util.jar.JarVerifier.processEntry(Unknown Source)
                at java.util.jar.JarVerifier.update(Unknown Source)
                at java.util.jar.JarFile.initializeVerifier(Unknown Source)
                at java.util.jar.JarFile.getInputStream(Unknown Source)
                at sun.net.www.protocol.jar.JarURLConnection.getInputStream(Unknown Source)
                at java.net.URLClassLoader.getResourceAsStream(Unknown Source)
                at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:433)
                at org.apache.juli.ClassLoaderLogManager.lambda$getClassLoaderInfo$2(ClassLoaderLogManager.java:395)
        <snip>

        Stacktrace from Java 17:

        22-Mar-2024 06:24:10.116 SEVERE [main] org.apache.catalina.startup.Bootstrap.main Init exception
        java.lang.StackOverflowError
        at java.base/jdk.internal.loader.URLClassPath.findResource(URLClassPath.java:297)
        at java.base/java.net.URLClassLoader$2.run(URLClassLoader.java:629)
        at java.base/java.net.URLClassLoader$2.run(URLClassLoader.java:627)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
        at java.base/java.net.URLClassLoader.findResource(URLClassLoader.java:626)
        at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:425)
        at org.apache.juli.ClassLoaderLogManager.lambda$getClassLoaderInfo$2(ClassLoaderLogManager.java:395)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
        at org.apache.juli.ClassLoaderLogManager.getClassLoaderInfo(ClassLoaderLogManager.java:393)
        at org.apache.juli.ClassLoaderLogManager.findProperty(ClassLoaderLogManager.java:282)
        at org.apache.juli.ClassLoaderLogManager.getProperty(ClassLoaderLogManager.java:269)
        at java.logging/java.util.logging.LogManager.getLevelProperty(LogManager.java:2342)
        at java.logging/java.util.logging.LogManager$LoggerContext.addLocalLogger(LogManager.java:802)
        at java.logging/java.util.logging.LogManager$LoggerContext.ensureDefaultLogger(LogManager.java:752)
        at java.logging/java.util.logging.LogManager$LoggerContext.ensureAllDefaultLoggers(LogManager.java:716)
        at java.logging/java.util.logging.LogManager$LoggerContext.addLocalLogger(LogManager.java:774)
        at java.logging/java.util.logging.LogManager$LoggerContext.addLocalLogger(LogManager.java:758)
        at java.logging/java.util.logging.LogManager$SystemLoggerContext.demandLogger(LogManager.java:939)
        at java.logging/java.util.logging.LogManager.demandSystemLogger(LogManager.java:559)
        at java.logging/java.util.logging.LogManager$LoggingProviderAccess.demandLoggerFor(LogManager.java:2729)
        at java.logging/sun.util.logging.internal.LoggingProviderImpl.demandJULLoggerFor(LoggingProviderImpl.java:412)
        at java.logging/sun.util.logging.internal.LoggingProviderImpl.demandLoggerFor(LoggingProviderImpl.java:438)
        at java.base/jdk.internal.logger.DefaultLoggerFinder.getLogger(DefaultLoggerFinder.java:159)
        at java.base/jdk.internal.logger.LazyLoggers.getLoggerFromFinder(LazyLoggers.java:410)
        at java.base/jdk.internal.logger.LazyLoggers.getLazyLogger(LazyLoggers.java:465)
        at java.base/jdk.internal.logger.LazyLoggers.getLogger(LazyLoggers.java:435)
        at java.base/java.lang.System.getLogger(System.java:1773)
        at java.base/jdk.internal.event.EventHelper.isLoggingSecurity(EventHelper.java:148)
        at java.base/sun.security.jca.JCAUtil.tryCommitCertEvent(JCAUtil.java:102)
        at java.base/java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:356)
        at java.base/sun.security.pkcs.PKCS7.parseSignedData(PKCS7.java:301)
        at java.base/sun.security.pkcs.PKCS7.parse(PKCS7.java:158)
        at java.base/sun.security.pkcs.PKCS7.parse(PKCS7.java:126)
        at java.base/sun.security.pkcs.PKCS7.<init>(PKCS7.java:108)
        at java.base/sun.security.util.SignatureFileVerifier.<init>(SignatureFileVerifier.java:125)
        at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:308)
        at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:239)
        at java.base/java.util.jar.JarFile.initializeVerifier(JarFile.java:761)
        at java.base/java.util.jar.JarFile.getInputStream(JarFile.java:849)
        at java.base/sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:187)
        at java.base/java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:296)
        at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:433)
        at org.apache.juli.ClassLoaderLogManager.lambda$getClassLoaderInfo$2(ClassLoaderLogManager.java:395)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
        at org.apache.juli.ClassLoaderLogManager.getClassLoaderInfo(ClassLoaderLogManager.java:393)
        at org.apache.juli.ClassLoaderLogManager.findProperty(ClassLoaderLogManager.java:282)
        at org.apache.juli.ClassLoaderLogManager.getProperty(ClassLoaderLogManager.java:269)
        at java.logging/java.util.logging.LogManager.getLevelProperty(LogManager.java:2342)
        at java.logging/java.util.logging.LogManager$LoggerContext.addLocalLogger(LogManager.java:802)
        at java.logging/java.util.logging.LogManager$LoggerContext.ensureDefaultLogger(LogManager.java:752)
        at java.logging/java.util.logging.LogManager$LoggerContext.ensureAllDefaultLoggers(LogManager.java:716)
        at java.logging/java.util.logging.LogManager$LoggerContext.addLocalLogger(LogManager.java:774)
        at java.logging/java.util.logging.LogManager$LoggerContext.addLocalLogger(LogManager.java:758)
        at java.logging/java.util.logging.LogManager$SystemLoggerContext.demandLogger(LogManager.java:939)
        at java.logging/java.util.logging.LogManager.demandSystemLogger(LogManager.java:559)
        at java.logging/java.util.logging.LogManager$LoggingProviderAccess.demandLoggerFor(LogManager.java:2729)
        at java.logging/sun.util.logging.internal.LoggingProviderImpl.demandJULLoggerFor(LoggingProviderImpl.java:412)
        at java.logging/sun.util.logging.internal.LoggingProviderImpl.demandLoggerFor(LoggingProviderImpl.java:438)
        at java.base/jdk.internal.logger.DefaultLoggerFinder.getLogger(DefaultLoggerFinder.java:159)
        at java.base/jdk.internal.logger.LazyLoggers.getLoggerFromFinder(LazyLoggers.java:410)
        at java.base/jdk.internal.logger.LazyLoggers.getLazyLogger(LazyLoggers.java:465)
        at java.base/jdk.internal.logger.LazyLoggers.getLogger(LazyLoggers.java:435)
        at java.base/java.lang.System.getLogger(System.java:1773)
        at java.base/jdk.internal.event.EventHelper.isLoggingSecurity(EventHelper.java:148)
        at java.base/sun.security.jca.JCAUtil.tryCommitCertEvent(JCAUtil.java:102)
        at java.base/java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:356)
        at java.base/sun.security.pkcs.PKCS7.parseSignedData(PKCS7.java:301)
        at java.base/sun.security.pkcs.PKCS7.parse(PKCS7.java:158)
        at java.base/sun.security.pkcs.PKCS7.parse(PKCS7.java:126)
        at java.base/sun.security.pkcs.PKCS7.<init>(PKCS7.java:108)
        at java.base/sun.security.util.SignatureFileVerifier.<init>(SignatureFileVerifier.java:125)
        at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:308)
        at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:239)
        at java.base/java.util.jar.JarFile.initializeVerifier(JarFile.java:761)
        at java.base/java.util.jar.JarFile.getInputStream(JarFile.java:849)
        at java.base/sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:187)
        at java.base/java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:296)
        at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:433)
        at org.apache.juli.ClassLoaderLogManager.lambda$getClassLoaderInfo$2(ClassLoaderLogManager.java:395)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
        at org.apache.juli.ClassLoaderLogManager.getClassLoaderInfo(ClassLoaderLogManager.java:393)
        at org.apache.juli.ClassLoaderLogManager.findProperty(ClassLoaderLogManager.java:282)
        at org.apache.juli.ClassLoaderLogManager.getProperty(ClassLoaderLogManager.java:269)
        at java.logging/java.util.logging.LogManager.getLevelProperty(LogManager.java:2342)
        at java.logging/java.util.logging.LogManager$LoggerContext.addLocalLogger(LogManager.java:802)
        at java.logging/java.util.logging.LogManager$LoggerContext.ensureDefaultLogger(LogManager.java:752)
        at java.logging/java.util.logging.LogManager$LoggerContext.ensureAllDefaultLoggers(LogManager.java:716)
        at java.logging/java.util.logging.LogManager$LoggerContext.addLocalLogger(LogManager.java:774)
        at java.logging/java.util.logging.LogManager$LoggerContext.addLocalLogger(LogManager.java:758)
        at java.logging/java.util.logging.LogManager$SystemLoggerContext.demandLogger(LogManager.java:939)
        at java.logging/java.util.logging.LogManager.demandSystemLogger(LogManager.java:559)
        at java.logging/java.util.logging.LogManager$LoggingProviderAccess.demandLoggerFor(LogManager.java:2729)
        at java.logging/sun.util.logging.internal.LoggingProviderImpl.demandJULLoggerFor(LoggingProviderImpl.java:412)
        at java.logging/sun.util.logging.internal.LoggingProviderImpl.demandLoggerFor(LoggingProviderImpl.java:438)
        at java.base/jdk.internal.logger.DefaultLoggerFinder.getLogger(DefaultLoggerFinder.java:159)
        at java.base/jdk.internal.logger.LazyLoggers.getLoggerFromFinder(LazyLoggers.java:410)
        at java.base/jdk.internal.logger.LazyLoggers.getLazyLogger(LazyLoggers.java:465)
        at java.base/jdk.internal.logger.LazyLoggers.getLogger(LazyLoggers.java:435)
        at java.base/java.lang.System.getLogger(System.java:1773)

        <snip>
        at java.base/jdk.internal.event.EventHelper.isLoggingSecurity(EventHelper.java:148)
        at java.base/sun.security.jca.JCAUtil.tryCommitCertEvent(JCAUtil.java:102)
        at java.base/java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:356)
        at java.base/sun.security.pkcs.PKCS7.parseSignedData(PKCS7.java:301)
        at java.base/sun.security.pkcs.PKCS7.parse(PKCS7.java:158)
        at java.base/sun.security.pkcs.PKCS7.parse(PKCS7.java:126)
        at java.base/sun.security.pkcs.PKCS7.<init>(PKCS7.java:108)
        at java.base/sun.security.util.SignatureFileVerifier.<init>(SignatureFileVerifier.java:125)
        at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:308)
        at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:239)
        at java.base/java.util.jar.JarFile.initializeVerifier(JarFile.java:761)
        at java.base/java.util.jar.JarFile.getInputStream(JarFile.java:849)
        at java.base/sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:187)
        at java.base/java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:296)
        at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:433)
        at org.apache.juli.ClassLoaderLogManager.lambda$getClassLoaderInfo$2(ClassLoaderLogManager.java:395)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
        at org.apache.juli.ClassLoaderLogManager.getClassLoaderInfo(ClassLoaderLogManager.java:393)
        at org.apache.juli.ClassLoaderLogManager.findProperty(ClassLoaderLogManager.java:282)
        at org.apache.juli.ClassLoaderLogManager.getProperty(ClassLoaderLogManager.java:269)
        at java.logging/java.util.logging.LogManager.getLevelProperty(LogManager.java:2342)
        at java.logging/java.util.logging.LogManager$LoggerContext.addLocalLogger(LogManager.java:802)
        at java.logging/java.util.logging.LogManager$LoggerContext.ensureDefaultLogger(LogManager.java:752)
        at java.logging/java.util.logging.LogManager$LoggerContext.ensureAllDefaultLoggers(LogManager.java:716)
        at java.logging/java.util.logging.LogManager$LoggerContext.addLocalLogger(LogManager.java:774)


        FREQUENCY : always

        Attachments

          Issue Links

            Activity

              People

                coffeys Sean Coffey
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: