As per this question I have created a class that implements the Catalina LifecycleListener class.
How to run script on Tomcat startup?
When I place my JAR file in webapps/ROOT/WEB-INF/lib, Tomcat fails to startup with a class not found exception:
java.lang.ClassNotFoundException: net.company.tomcat.StartupEventHookListener
But when I place the file in appserver/lib it starts up and then runs the code as expected, when the app has finished starting.
My understanding is that all JAR files in the WEB-INF/lib are available to my webapp (ROOT), and I am trying to hook into the event lifecycle for my webapp.
Am I actually hooking into Tomcat's lifecycle, hence I need to use the appserver/lib library?
Did I just answer my own question?