springboot中java.lang.IllegalStateException加载App lication Context失败该怎么解决
springboot中java.lang.IllegalStateException加载App lication Context失败该怎么解决,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。
解决方案:
在测试文件上加上下面两个注解就好了 @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT,classes = Application.class)
看完上述内容,你们掌握springboot中java.lang.IllegalStateException加载App lication Context失败该怎么解决的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注行业资讯频道,感谢各位的阅读!