I am trying to port web applications from JBoss to Spring Boot, but you have an inexplicable problem with VERY slow startup time. Even a simple application from Spring's Download Guide - "Processing a Presentation Form" (packaged as a thick JAR using Java 1.8) runs on some computers in 3 seconds and on others in 30 seconds. and it gets worse for large web applications (WAR-packed with JSF, Hibernate, etc.) - the startup time is 13 seconds versus 1500 seconds (115 times longer!). Similar applications run under JBoss or Liberty application servers, which run quickly everywhere. Not sure if these are security settings, network, firewall or antivirus tools.
Looking at the log file, it looks like the application is spending a lot of time scanning JARs for TLD files and reflection. Strange, but this is not a problem for applications running in JBoss or Liberty - Iām not sure that the same scan is happening there.
As far as I understand, this is done for servlet specifications, but is there a way to skip scanning some JARs? Where can I add the catalina.properties file in a Spring boot application packaged as a WAR as suggested in the post?
Here are sample log messages:
org.apache.jasper.servlet.TldScanner : No TLD files were found in [jar:file:/C:/Development/workspace-Cloud/PrimeFacesDemoSBwar/target/primefacesdemoSB.war!/WEB-INF/lib/primefaces-5.3.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
...
org.reflections.Reflections : Reflections took 79406 ms to scan 7 urls, producing 972 keys and 4573 values
source share