Search code examples
javaspring-mvctomcatapache-cameltomcat10

Error in camel-servletlistener and springframework.web while running in tomcat 10


I have a spring web-app which uses camel-servletlistener(2.25.4), camel-urlrewrite(2.25.4) and springframework.web(5.3.15) internally. these dependencies uses javax.servlet internally because of which my web-app is not running in tomcat-10. can i know what should be done so that my web-app supports tomcat-10 too. I have replaced all the javax dependencies to jakarta.

i getting following error.

06-Apr-2022 11:05:56.002 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [org.springframework.web.context.ContextLoaderListener]
    java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener

Solution

  • Apache Camel doesn't support Jakarta EE yet thus it cannot work for now on Tomcat 10. There is an ongoing task about that https://issues.apache.org/jira/browse/CAMEL-17136, you can follow it to know when it will be supported.

    Your second option is to use Tomcat 9 instead.