分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 技术分享

Failed to configure a DataSource 'url' attribute问题解决

发布时间:2023-09-06 02:32责任编辑:苏小强关键词:url

才写了一行代码又报错了..

***************************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).Disconnected from the target VM, address: ‘127.0.0.1:58792‘, transport: ‘socket‘Process finished with exit code 0

未指定“url”属性,无法配置嵌入的数据源。

原因:由于添加了数据库组件,所以autoconfig会去读取数据源配置,新建的项目还没有配置数据源,所以会导致异常出现。

解决办法:
在启动类添加如下内容
即:@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
----------------
转自:悟世君子的博客

Failed to configure a DataSource 'url' attribute问题解决

原文地址:https://www.cnblogs.com/zilongmao/p/10351315.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved