Spring Web Services Tomcat Compatibility

In this post we attempt to help you choose the appropriate version of Tomcat when using Spring Web Services.

As context, if you’ve developed a web service, using Spring Web Services, chances are you’ve blissfully been using the Maven Jetty Plugin in your project during the development phase. When you’re getting ready to deploy to Tomcat however, you may need to know what the Servlet/JSP Spec version supported by Spring Web Services is since this is how the Tomcat Which Version page guides users in their decision making process.

Here are steps that could be used to determine the relevant Servlet/JSP Spec version and hence Tomcat version:

  1. Run mvn dependency:tree
  2. Look for the org.springframework.ws:spring-ws-core line and then for the version number of its org.springframework:spring-webmvc line, in our case, we have 3.1.0.RELEASE as the version
  3. Now look at the dependencies of the version of spring-webmvc and in turn it’s org.apache.tomcat:tomcat-servlet-api dependency, in our case, we find that we find that we are depedant on tomcat-servlet-api version 7.0.8
  4. Finally, have a look at the MANIFEST of the above mentioned jar, and here you will find the relevant Servlet Spec, in our case we find: Specification-Title : Java API for Servlets, Specification-Version : 3.0
  5. Choose Tomcat 7 as advised.