简体   繁体   中英

org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already

I am getting below mentioned tomcat log.

30-Jun-2022 09:45:37.926 INFO [Timer-0] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [META-INF/services/javax.xml.parsers.DocumentBuilderFactory]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
        java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [META-INF/services/javax.xml.parsers.DocumentBuilderFactory]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
                at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1384)
                at org.apache.catalina.loader.WebappClassLoaderBase.findResources(WebappClassLoaderBase.java:984)
                at org.apache.catalina.loader.WebappClassLoaderBase.getResources(WebappClassLoaderBase.java:1085)
                at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:348)
                at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
                at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
                at javax.xml.parsers.FactoryFinder$1.run(FactoryFinder.java:293)
                at java.security.AccessController.doPrivileged(Native Method)
                at javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:289)
                at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:267)
                at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:119)
                at java.util.prefs.XmlSupport.createPrefsDoc(XmlSupport.java:225)
                at java.util.prefs.XmlSupport.exportMap(XmlSupport.java:343)
                at java.util.prefs.FileSystemPreferences$7.run(FileSystemPreferences.java:634)
                at java.util.prefs.FileSystemPreferences$7.run(FileSystemPreferences.java:627)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.prefs.FileSystemPreferences.writeBackCache(FileSystemPreferences.java:626)
                at java.util.prefs.FileSystemPreferences.syncSpiPrivileged(FileSystemPreferences.java:813)
                at java.util.prefs.FileSystemPreferences.access$2300(FileSystemPreferences.java:50)
                at java.util.prefs.FileSystemPreferences$12.run(FileSystemPreferences.java:783)
                at java.util.prefs.FileSystemPreferences$12.run(FileSystemPreferences.java:781)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.prefs.FileSystemPreferences.syncSpi(FileSystemPreferences.java:780)
                at java.util.prefs.AbstractPreferences.sync2(AbstractPreferences.java:1338)
                at java.util.prefs.AbstractPreferences.sync2(AbstractPreferences.java:1343)
                at java.util.prefs.AbstractPreferences.sync(AbstractPreferences.java:1329)
                at java.util.prefs.FileSystemPreferences.sync(FileSystemPreferences.java:759)
                at java.util.prefs.FileSystemPreferences.flush(FileSystemPreferences.java:836)
                at java.util.prefs.FileSystemPreferences.syncWorld(FileSystemPreferences.java:476)
                at java.util.prefs.FileSystemPreferences.access$1200(FileSystemPreferences.java:50)
                at java.util.prefs.FileSystemPreferences$3.run(FileSystemPreferences.java:444)
                at java.util.TimerThread.mainLoop(Timer.java:555)
                at java.util.TimerThread.run(Timer.java:505)

I already tried to shutdown tomcat and re-deploy my spring boot application. However, this log is so consistent such that it came every 5 seconds. If someone know anything or have any guess. Please explain what's this error about? And How to resolve it?

You are scheduling a TimerTask in a web application and not cancelling the Timer when the web application is undeployed. Use a ServletContextListener to cancel the Timer in the contextDestroyed() method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM