Exception in thread "DubboShutdownHook"

本地启动tomcat时报一下错误是什么原因:

Exception in thread "DubboShutdownHook" java.lang.NoClassDefFoundError: com/alibaba/dubbo/registry/support/AbstractRegistryFactory
at com.alibaba.dubbo.config.ProtocolConfig.destroyAll(ProtocolConfig.java:429)
at com.alibaba.dubbo.config.AbstractConfig$1.run(AbstractConfig.java:452)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: Illegal access: this web application instance has been stopped already. Could not load [com.alibaba.dubbo.registry.support.AbstractRegistryFactory]. 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:1343)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1206)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
... 3 more
Caused by: java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [com.alibaba.dubbo.registry.support.AbstractRegistryFactory]. 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:1353)
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1341)
... 5 more

少包或者包冲突,建议反编译看看异常的代码和看看需要的包

没找到 com/alibaba/dubbo/registry/support/AbstractRegistryFactory

楼上正解,试试反编译应该可以

最终的原因是这个:

 Illegal access: this web application instance has been stopped already. Could not load [com.alibaba.dubbo.registry.support.AbstractRegistryFactory]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.

web应用的实例已经停止了,所以加载不到 相关的类。你这个 钩子Hook做得有问题