Intellij idea配置SpringBoot报错

编程入门 行业动态 更新时间:2024-10-12 14:21:27
Description: Failed to auto-configure a DataSource: 'spring.datasource.url'
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).

翻译:

Description: Failed to auto-configure a DataSource: 'spring.datasource.url'
描述:未能自动配置数据源:“春天。DataSource。URL”
Consider the following:
考虑以下:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
如果你想要一个嵌入式数据库(H2,HSQL或Derby),请把它放在类路径。
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
如果要从特定的配置文件中加载数据库设置,可能需要激活它(目前没有配置文件)。

解决方法:

第一种、配置数据库的数据源,

第二种、在启动类中配置

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)或者
@EnableAutoConfiguration(exclude = DataSourceAutoConfiguration.class)

更多推荐

Intellij idea配置SpringBoot报错

本文发布于:2023-06-13 07:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1357642.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报错   Intellij   idea   SpringBoot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!