1. 程式人生 > >Web專案中引入Redis引發的錯誤資訊

Web專案中引入Redis引發的錯誤資訊

在這裡插入圖片描述
報錯資訊

Illegal access: this web application instance has been stopped already.  Could not load redis.clients.util.IOUtils.  The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1612)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    at redis.clients.jedis.Connection.disconnect(Connection.java:226)
    at redis.clients.jedis.BinaryClient.disconnect(BinaryClient.java:941)
    at redis.clients.jedis.BinaryJedis.disconnect(BinaryJedis.java:1771)
    at redis.clients.jedis.JedisFactory.destroyObject(JedisFactory.java:91)
    at org.apache.commons.pool2.impl.GenericObjectPool.destroy(GenericObjectPool.java:897)
    at org.apache.commons.pool2.impl.GenericObjectPool.evict(GenericObjectPool.java:793)
    at org.apache.commons.pool2.impl.BaseGenericObjectPool$Evictor.run(BaseGenericObjectPool.java:1036)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)

Exception in thread "commons-pool-EvictionTimer" java.lang.NoClassDefFoundError: redis/clients/util/IOUtils

異常資訊的內容是:無法載入redis/clients/util/IOUtils的Class檔案,追究其原因是因為Tomcat在重新部署專案的時候,關閉了類載入器,但是有一些執行緒仍然在執行,所以會報錯。並不影響正常使用。

小知識點:reloadable設為true,專案發生改變,會自動reload,就會造成上面異常的情況,可以在除錯,還沒上線的時候使用,會增加伺服器壓力稱之為熱部署。reloaded為false,專案發生改變不會reload,適用於專案上線時。

– 我是修改了攔截器中的配置,然後報這個錯誤,和本文說明吻合!知道問題就不慌啦!感謝作者!

原文地址:https://blog.csdn.net/Amos_hongli/article/details/78591226