Web项目中引入Redis引发的错误信息

时间:2024-02-22 17:42:01

在这里插入图片描述
报错信息

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