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

Web项目中引入Redis引发的错误信息_第1张图片
报异常提示:

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,适用于项目上线时。

你可能感兴趣的:(web,redis缓存)