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.
React + Spring Boot Microservices and SpringBy using Spring Boot application, we can create a war file to deploy into the web server. In this chapter, you are going to learn how to create a WAR file and deploy the Spring Boot application in Tomcat web server.
Perhaps the simplest way to deploy a WAR file to Tomcat is to copy the file to Tomcat's webapps directory. Copy and paste WAR files into Tomcat's webapps directory to deploy them. Tomcat monitors this webapps directory for changes, and if it finds a new file there, it will attempt to deploy it.
You can not deploy Jar to tomcat and expect it to load your web application. War has its own directory and file structure defined which is read by tomcat and load the application accordingly. It can not understand jar file as web application and run it.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With