On Tue, Dec 18, 2018 at 7:33 AM Ryan Palmer <ryangpal...@hotmail.com> wrote:
> Hello, > > I'm using the Tomcat class to embed the container in my application. I > have configured the CATLINA_HOME and _BASE properties, and I know those are > working because the 'work' folder gets generated there as expected. However > if I put a server.xml file in a 'conf' folder in the same directory, it > does not seem to be loaded when calling Tomcat.init(). > > Documentation is very sparse on the Tomcat class so I am unsure how to > configure it the "standard" way. > I very recently refactored Tomcat embedded (in Tomcat 9.0.14) to be more flexible, with the main assumption that trying to replicate a complex server.xml with Java code while keeping good configurability was a waste of resources. As for using it, there's "big jar" packaging (but with the important note that it remains EE webapp based, rather than proprietary): https://github.com/apache/tomcat/tree/trunk/res/tomcat-maven Or you can do it yourself, you need to use Tomcat.init(ConfigurationSource). You can use startup.CatalinaBaseConfigurationSource to replicate the default Tomcat behavior, or implement ConfigurationSource and have more flexibility. A few components don't use that abstraction because they persist configs (JASPIC, storeconfig). Rémy