Tomcat:PreResources标记没有加载jar

我正在使用tomcat 9,并试图从PreResources标签下面加载所有与项目相关的jar。

  

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元素的示例和文档非常少。 任何方向或帮助将不胜感激。

这应该是context.xml的内容。 它解决了我的问题。

       

“Base”是外部资源的路径,“webAppMount”是您要安装这些资源的位置。