Search code examples
javaspringtomcatspring-boot

Tomcat 7.0.25 SessionIdGenerator exception


I'm deploying a spring-boot application with tomcat 7.0.70 and works fine. My problem is that I need it running with tomcat 7.0.25, and when I change the dependency I can't even run the application, the exceptions are:

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.NoClassDefFoundError: org/apache/catalina/SessionIdGenerator
Caused by: java.lang.NoClassDefFoundError: org/apache/catalina/SessionIdGenerator
Caused by: java.lang.ClassNotFoundException: org.apache.catalina.SessionIdGenerator

I have try all, I surfed nearly all Google and StackOverflow but I can't find a way to include this in my application.

The problem is that working with 7.0.25 is a must, and I guess that if with the embed 7.0.25 doesn't work, in production I will have a problem.

Any tip on how to solve that error would be VERY appreciated.

Lot of thanks!


Solution

  • It looks like Spring Boot depends on the class that is mentioned in the exception (org.apache.catalina.SessionIdGenerator).

    According to the sources of Apache Tomcat this class is available from 7.0.58 version, so you can't use older version.

    You did not provide information which version of Spring Boot you are using, but you can try using older version.