关联这个错误
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘serverEndpointExporter’ defined in class path resource
在这里我是在junit测试的时候报的错
百度了一上午终于解决了,参考文献 https://blog.csdn.net/kxj19980524/article/details/88751114
解决办法如下
第一步,在pom.xml中添加下面两个依赖、
<!--取出内嵌tomcat-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
</dependency>`
第二步,在junit测试类上添加注解内容
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
结果出来了