SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer

后端 未结 6 1440
广开言路
广开言路 2020-12-03 11:09

I am attempting to move a xml-based Spring MVC app to a Java Configuration based app. There appears to be a mismatch with the various java.servlet classes available in mave

6条回答
  •  一生所求
    2020-12-03 11:19

    I had a similar problem without Spring, where mvn tomcat7:run did not work, despite the servlet deploying to OpenShift just fine. As per Biju Kunjummen's answer, the problem for me was which servlet-api I was compiling against.

    Broken:

    
        javax.servlet
        javax.servlet-api
        3.0.1
        provided
    
    

    Fixed:

    
        org.mortbay.jetty
        servlet-api
        3.0.20100224
        provided
    
    

    Not terribly sure why, but it works now.

提交回复
热议问题