首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >正在从start.spring运行项目,但出现错误

正在从start.spring运行项目,但出现错误
EN

Stack Overflow用户
提问于 2018-03-07 01:28:43
回答 2查看 4.5K关注 0票数 4

我正在用Maven Java 2.0.0从start.spring.io下载项目。使用Java SDK 9在Intellij中打开它,按run,出现以下错误

代码语言:javascript
复制
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-03-06 18:25:17.342 ERROR 1768 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to auto-configure a DataSource: 'spring.datasource.url' is not specified and no embedded datasource could be auto-configured.

Reason: Failed to determine a suitable driver class
EN

回答 2

Stack Overflow用户

发布于 2018-03-07 01:30:51

某些默认的Spring Boot配置必须有一个javax.sql.DataSource类型的Bean。如果定义了多个DataSource实现,则必须将其中一个声明为primary

如果做不到这一点,Spring将默认根据几个属性查找现有数据库。请参阅this webpage标题为“连接到生产数据库”的部分。

票数 0
EN

Stack Overflow用户

发布于 2018-09-15 16:55:32

可能会迟到,但可能对其他人有用。

当我试图从spring boot应用程序连接PostgreSql DB时,我遇到了这个问题。我在pom.xml中使用了资源"< resources >“过滤器,它过滤掉了一些需要的sql文件。当我删除这个错误时,这个错误已经消失了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49136725

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档