ERROR:o.s.b.d.LoggingFailureAnalysisReporter解决办法 APPLICATION FAILED TO START APPLICATioN FAILE
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
--结束END--
本文标题: ERROR:o.s.b.d.LoggingFailureAnalysisReporter解决办法
本文链接: https://www.lsjlt.com/news/415812.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-04-01
2024-04-03
2024-04-03
2024-01-21
2024-01-21
2024-01-21
2024-01-21
2023-12-23
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0