我正在用Maven Java 2.0.0从start.spring.io下载项目。使用Java SDK 9在Intellij中打开它,按run,出现以下错误
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发布于 2018-03-07 01:30:51
某些默认的Spring Boot配置必须有一个javax.sql.DataSource类型的Bean。如果定义了多个DataSource实现,则必须将其中一个声明为primary。
如果做不到这一点,Spring将默认根据几个属性查找现有数据库。请参阅this webpage标题为“连接到生产数据库”的部分。
发布于 2018-09-15 16:55:32
可能会迟到,但可能对其他人有用。
当我试图从spring boot应用程序连接PostgreSql DB时,我遇到了这个问题。我在pom.xml中使用了资源"< resources >“过滤器,它过滤掉了一些需要的sql文件。当我删除这个错误时,这个错误已经消失了。
https://stackoverflow.com/questions/49136725
复制相似问题