Application startup failed org.springframework.beans.factory.BeanDefinitionStoreException

最近使用了spring boot开发项目,但是对这个框架的了解不深,现在把每次遇到的坑发出来作为记录。

错误

Application startup failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.tjr.supervisory.system.SupervisorySystemApplication]; nested exception is org.springframework.core.NestedIOException: Failed to load class [javax.servlet.ServletContextListener]; nested exception is java.lang.ClassNotFoundException: javax.servlet.ServletContextListener

解决方式
注释掉这段gradle代码 ,记得好像是之前导出war包时候用的。 (provided表明该包只在编译和测试的时候用!)
providedRuntime(‘org.springframework.boot:spring-boot-starter-tomcat:1.5.9.RELEASE’)

然后就可以运行了

猜你喜欢

转载自blog.csdn.net/a961011576/article/details/81837330
今日推荐