0
我在Tomcat中使用LifecycleListener來初始化Web服務器中上下文所需的一些對象。在LifecycleListener中,我希望能夠訪問GlobalNamingResources環境變量,以便將服務器的配置保存在server.xml文件中。嘗試各種方法時,出現以下錯誤:在Tomcat LifecycleListener中獲取對jndi環境變量的訪問
javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
我假設jndi沒有被服務器啓動過程的這個階段初始化。有關如何解決這個問題的任何想法?