Failed to instantiate [org.springframework.test.context.web.ServletTestExecute
有时候 启动springBoot 会报错,test时有时也是,
类似 Failed to instantiate [org.springframework.test.context.web.ServletTestExecute,
java.lang.NoClassDefFoundError: javax/servlet/ServletContext
这样的错误,
我遇到这个问题的原因,是因为引用的 依赖版本不正确,
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>4.3.2.RELEASE</version> <scope>test</scope> </dependency>
原来引用的是 3.XXX 的版本,改为以上版本就可以了