ERROR:o.s.b.d.LoggingFailureAnalysisReporter解决办法
ERROR:o.s.b.d.LoggingFailureAnalysisReporter解决办法
APPLICATION FAILED TO START
Description:Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.Reason: Failed to determine a suitable driver classAction:Consider the following:If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).Process finished with exit code 1
@SpringBootApplication定义是个Spring Boot应用;@EnableDiscoveryClient开启Spring Cloud的服务注册与发现,由于这里引入了spring-cloud-starter-alibaba-nacos-discovery模块,所以Spring Cloud Common中定义的那些与服务治理相关的接口将使用Nacos的实现。
这里需要注意:如果直接使用@SpringBootApplication注解,后面不加参数,启动的时候会报错,如下:
经过排查:是因为springboot启动时会自动注入数据源和配置jpa
所以解决方法:
在@SpringBootApplication中排除其注入
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class})
简单的在Controller文件中写一个@RequestMapping(“/login”)打头的
@RestController@RequestMapping("/login")public class UserController { @GetMapping public String getUsers() { return "Hello Spring Security"; }}
启动Application之后,无法成功运行,报错o.s.b.d.LoggingFailureAnalysisReporter ERROR;
解决办法:
在Application中将仅仅的@SpringBootApplication修改成:
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
来源地址:https://blog.csdn.net/weixin_43333233/article/details/128543696
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341