SpringBoot项目运行报错:Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContext
·
启动eureka项目时报错,报错信息如下:
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.xxx.EurekaServerApplication]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.web.servlet.support.SpringBootServletInitializer
解决方法:将对应服务下的provided修改为compile
******scope******
1.compile:默认范围,编译测试运行都有效
2.provided:在编译和测试时有效
3.runtime:在测试和运行时有效
4.test:只在测试时有效
5.system:在编译和测试时有效,与本机系统关联,可移植性差
更多推荐




所有评论(0)