5
votes

I have developed a webapp with Spring Boot and generated the WAR. I have followed this instructions before generate the war. I'm deploying it in a Tomcat 7.0.52 but I get this:

INFO: validateJarFile(/opt/devel/server/apache-tomcat-7.0.52/webapps/myapp/WEB-INF/lib/tomcat-embed-el-8.0.32.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/el/Expression.class 2016-04-19 11:48:28.579 WARN 27983 --- [io-8080-exec-14] org.apache.catalina.deploy.WebXml : Unknown version string [3.1]. Default version will be used.

I thought it was due to servlet spec version, but in the link above says that it supports 3.0 as well as 3.1 (Tomcat 8). If I deploy my app in a Tomcat 8, everything works.

Thanks.

1
Spring Boot supports both specs.. Tomcat 7 doesn't...M. Deinum

1 Answers

7
votes

As M. Deinum mentioned, Tomcat 7 is using 3.0.x servet APIs. Spring Boot by default uses 3.1. To change it, Spring Boot understands these Maven properties if you are using older servlet and tomcat APIs:

<properties>
    <tomcat.version>7.0.69</tomcat.version>
    <servlet-api.version>3.0.1</servlet-api.version>
</properties>