无法加载[java.lang.Math]

时间:2017-06-08 09:07:43

标签: java apache tomcat

我已将tomcat和jdk升级到apache-tomcat-8.5.12和jdk1.8.0_121。但似乎我在启动后遇到错误。

请参阅下面的错误:

09-Jun-2017 00:37:31.776 INFO [Timer-0] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [java.lang.Math]. 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 [java.lang.Math]. 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:1305)
        at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1293)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1158)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
        at org.apache.commons.pool.impl.GenericObjectPool.calculateDeficit(GenericObjectPool.java:1647)
        at org.apache.commons.pool.impl.GenericObjectPool.ensureMinIdle(GenericObjectPool.java:1621)
        at org.apache.commons.pool.impl.GenericObjectPool.access$700(GenericObjectPool.java:190)
        at org.apache.commons.pool.impl.GenericObjectPool$Evictor.run(GenericObjectPool.java:1758)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)

Exception in thread "Timer-0" java.lang.NoClassDefFoundError: java/lang/Math
        at org.apache.commons.pool.impl.GenericObjectPool.calculateDeficit(GenericObjectPool.java:1647)
        at org.apache.commons.pool.impl.GenericObjectPool.ensureMinIdle(GenericObjectPool.java:1621)
        at org.apache.commons.pool.impl.GenericObjectPool.access$700(GenericObjectPool.java:190)
        at org.apache.commons.pool.impl.GenericObjectPool$Evictor.run(GenericObjectPool.java:1758)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.ClassNotFoundException: Illegal access: this web application instance has been stopped already. Could not load [java.lang.Math]. 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.checkStateForClassLoading(WebappClassLoaderBase.java:1295)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1158)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
        ... 6 more
Caused by: java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [java.lang.Math]. 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:1305)
        at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1293)
        ... 8 more

1 个答案:

答案 0 :(得分:1)

这是Tomcat的一个误导性错误消息,并不是导致问题的根本原因。由于出现其他问题,您的实例已经停止了。

在此之前查看Catalina(或任何其他)日志中出现的问题,这将是您的根本原因。此错误消息只是一个恼人的副作用。

最后,升级Tomcat时的一个好规则是从webapps文件夹中删除提取的webapp,以防止缓存问题,并让Tomcat重新部署Web存档。