I am using embedded tomcat to deploy my application's war file via maven appassembly plug-in. My application is built in Spring that uses WebApplicationInitializer instead of web.xml. The application gets deployed in embedded tomcat however when I add jamon.war (for instrumentation) to tomcat instance, my application's WebApplicationInitializer implementation is called again.
I spent almost 8-9 hours to figure this out but unable to, any help will be greatly appreciated. Code to create Tomcat instance and load the two wars is as mentioned below.
Tomcat tomcat = new Tomcat();
tomcat.setHostname("localhost");
tomcat.setPort(8080);
File appWar = new File("/home/myApp.war");
Context context = tomcat.addWebapp("", appWar.getAbsolutePath()); // This is my Spring app.
File jamonWar = new File("/home/jamon-war-2.4.war");
Context context = tomcat.addWebapp("", jamonWar.getAbsolutePath());
tomcat.start();