iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > JAVA >ERROR:o.s.b.d.LoggingFailureAnalysisReporter解决办法
  • 402
分享到

ERROR:o.s.b.d.LoggingFailureAnalysisReporter解决办法

springbootjavaspring 2023-09-22 22:09:06 402人浏览 八月长安
摘要

ERROR:o.s.b.d.LoggingFailureAnalysisReporter解决办法 APPLICATION FAILED TO START APPLICATioN FAILE

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

--结束END--

本文标题: ERROR:o.s.b.d.LoggingFailureAnalysisReporter解决办法

本文链接: https://www.lsjlt.com/news/415812.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作