Could not load org.apache.hadoop.util.ShutdownHookManager when shutdown tomcat server

拟墨画扇 提交于 2019-12-05 13:16:21

I have the same problem in a maven Mojo I'm building. I think that the problem is caused by the context class loader that loads hadoop classes in your web application. These definitions are not visible by the WebAppClassLoader class loader. When JVM shutdown occurs, shutdown hooks are being executed and that calls the ShutdownHookManager but it was loaded in now destroyed context class loader, and there you have the problem.

Putting hadoop jars in the lib directory of your tomcat will probably help. Or setting some *_CLASSPATH java option when you're starting tomcat. That way the WebAppClassLoader will have definitions of your classes.

Otherwise, you can just execute hadoop's shutdown hooks manually before you destroy your context and ignore the above exception.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!