ServletDispatcher cannot be cast to Javax.servlet.Servlet exception in my spring project

前端 未结 2 1627
-上瘾入骨i
-上瘾入骨i 2020-12-06 05:36

While starting tomcat server I am getting an exception

SEVERE: Servlet /MavenWeb threw load() exception
java.lang.ClassCastException: org.springframework.we         


        
2条回答
  •  感动是毒
    2020-12-06 06:11

    You shouldn't be using multiple versions of Spring JARs in one project, but this is not the issue.

    The problem is most likely caused by servlet API classes loaded by two different class-loaders. Probably you have servlet*.jar or some other container-specific JARs in your WAR. Remove them by setting their to provided in pom.xml.

提交回复
热议问题