SpringBoot异常No runnable methods,is unlikely to start due to ,failed to parse configuration class修改

异常一:

java.lang.Exception: No runnable methods

解决方案: SpringBoot的测试类执行方法上加@Test

异常二:

Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.

解决方案:在测试类上添加@SpringBootTest(classes = springboot主执行类的类名.class)

异常三:

** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class

解决方案: springboot的主执行类不能直接放在src/main/java下

猜你喜欢

转载自blog.csdn.net/xczjy200888/article/details/89713392