错误信息: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available 解决: 后来发现是pom.xml导入了mybatis包,需要在application.yml文件里面导入数据库信息 然后再重新启动项目,成功输出helloworld语句。