我正在使用tomcat 9,並嘗試從下面的PreResources標籤加載所有項目相關的罐子。Tomcat:PreResources標籤不加載罐子
<Resources className="org.apache.catalina.webresources.StandardRoot" cachingAllowed="true" cacheMaxSize="100000" allowLinking="true">
<PreResources className="org.apache.catalina.webresources.DirResourceSet"
base="D:\SomePath\apache-tomcat-9.0.0.M17-windows-x64-2\apache-tomcat-9.0.0.M17"
internalPath="/External-lib"
webAppMount="/WEB-INF/classes" />
External-lib文件夾位於tomcat目錄中,按照'base'中提到的路徑。但是當應用程序被部署時,我會得到以下錯誤。
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
這會從web.xml中調用,
org.springframework.web.context.ContextLoaderListener
在Tomcat的lib,我們剛剛tomcat的圖書館,那裏的其餘所有jar的是在External-lib文件夾中。由於我們有類似的webApp和jar太多,我們正試圖將它們外部化,而不是加載到webapp/web-inf/lib文件夾中。
請建議,我是否在使用PreResources元素從meta-inf/context.xml加載jar時錯過了任何內容。
這個PreResources元素的例子和文檔非常少。 任何方向或幫助,將不勝感激。