我一直致力于创建 Apache Tomcat 生命周期监听器。此监听器从文件中加载某些自定义配置数据,这些数据将在我开发的自定义阀门中使用。
我将此监听器添加到 server.xml,但似乎在执行监听器的 lifecycleEvent 方法之前,阀门已初始化。
因此,如果有人能向我提供关于在 server.xml 中定义的 Apache Tomcat 组件的启动顺序的想法,我将不胜感激,我认为这可能对我的问题有用。
最佳答案
您是否尝试过覆盖 ValveBase.initInternal()配置值,避免听众?
"Sub-classes wishing to perform additional initialization should override this method, ensuring that super.initInternal() is the first call in the overriding method."
关于java - Apache Tomcat server.xml 组件的启动顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35403457/