Adding external resources to class-path in Tomcat 8

There is a section about this in the Tomcat 8 migration guide which will direct you to use a resources configuration

In particular, you will be creating a WebResourceRoot object which contains the following text in its description.

VirtualWebappLoader – Replaced by Pre- and Post-Resources mapped to WEB-INF/lib and WEB-INF/classes

Your new context.xml will look something like the following:

<Context>
    <Resources className="org.apache.catalina.webresources.StandardRoot">
        <PreResources className="org.apache.catalina.webresources.DirResourceSet"
            base="C:\\PROJECT_NAME\\conf"
            internalPath="https://stackoverflow.com/"
            webAppMount="/WEB-INF/classes" />
    </Resources>
</Context>

Leave a Comment