0

Yesterday I was launching my Spring-boot app with new features and my app wasn't started. There was just the ordinary logs in catalina.out except to the WARNING log, that say me Tomcat 8 will use default xml version instead of specified mine:

 21-Sep-2020 16:46:33.348 INFO [http-nio-8080-exec-65] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/share/tomcat9/webapps/mobile-app-ws-0.0.1-SNAPSHOT.war]
21-Sep-2020 16:46:43.484 WARNING [http-nio-8080-exec-65] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0].Default version will be used .
21-Sep-2020 16:46:33.348 INFO [http-nio-8080-exec-65]  org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
21-Sep-2020 16:46:43.622 INFO [http-nio-8080-exec-65] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/share/tomcat9/webapps/mobile-app-ws-0.0.1-SNAPSHOT.war] has finished in [10,272] ms
                       

It was caused by what Tomcat 8 use xml version 3.1, but in my pom.xml set to 4.0. So I choose to install Tomcat 9 on my Linux server. I was thinking that my app doesn't start because of conflict between default Tomcat XML version and XML version in my pom.xml. So, here I am. On Tomcat 9 the same simple logs and isn't any clue of what goes wrong:

22-Sep-2020 16:46:33.348 INFO [http-nio-8080-exec-65] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/share/tomcat9/webapps/mobile-app-ws-0.0.1-SNAPSHOT.war]
22-Sep-2020 16:46:43.484 INFO [http-nio-8080-exec-65] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
22-Sep-2020 16:46:43.622 INFO [http-nio-8080-exec-65] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/share/tomcat9/webapps/mobile-app-ws-0.0.1-SNAPSHOT.war] has finished in [10,272] ms.

On my local computer I have this logs during deploying:

22-Sep-2020 19:46:49.238 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.37]
22-Sep-2020 19:46:49.253 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/home/etniqa/etniqa/utilities/apache-tomcat-9.0.37/webapps/mobile-app-ws-0.0.1-SNAPSHOT.war]
22-Sep-2020 19:46:58.919 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
SOUT INTO MAIN CLASS INTO INIT-STATIC SNIPPET
22-Sep-2020 19:46:59.051 INFO [main] com.example.mobileappws.MobileAppWsApplication.<clinit> LOG INTO MAIN CLASS INTO INIT-STATIC SNIPPET

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.3.1.RELEASE)

2020-09-22 19:47:00.952  INFO 19842 --- [           main] c.e.mobileappws.MobileAppWsApplication   : Starting MobileAppWsApplication v0.0.1-SNAPSHOT on etniqa with PID 19842 (/home/etniqa/etniqa/utilities/apache-tomcat-9.0.37/webapps/mobile-app-ws-0.0.1-SNAPSHOT/WEB-INF/classes started by etniqa in /home/etniqa/etniqa/utilities/apache-tomcat-9.0.37/bin)

and it works perfectly.

I had the similar problem a week ago. Then I just have set version of JDK 8 in pom.xml:

<properties>
    <java.version>1.8</java.version>
</properties>

Versions on my Linux server: JDK:

openjdk version "1.8.0_265"

Tomcat:

Server version: Apache Tomcat/9.0.38

  • Are you using embedded tomcat or external tomcat? Spring boot apps usually have embedded server. If external tomcat, it should have nothing to do with pom.xml but with web.xml on tomcat. Checkout this link for version correspondence https://www.programmersought.com/article/78891066902/ – Vishal Sep 22 '20 at 19:00
  • try using embedded tomcat ,else refer this [link](https://stackoverflow.com/questions/14375673/how-to-fix-jsp-compiler-warning-one-jar-was-scanned-for-tlds-yet-contained-no-t/45751740) – souvikbachhar Sep 22 '20 at 19:58
  • your suggestion of downgrading Java worked for me - had the same issue. But in Docker I used the Tomcat 9 version - maybe my answer may help https://stackoverflow.com/questions/72058697/tomcat-deploys-war-file-but-application-doesnt-start-in-a-docker-container/72743574#72743574 – xenn_33 Jun 24 '22 at 11:48

0 Answers0