Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.


Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

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 class

 

原因:新创建的项目没有配置数据源  所以在项目启动的时候回去查找项目的数据源,但是发现找不到所以报错。

           如果配置了数据源之后  就算是没有排除自动配置数据源。

 

解决办法:

 

 

 

在启动类注解上

  @SpringBootApplication(exclude = DataSourceAutoConfiguration.class)

然后启动成功!

如果还不成功,
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@ComponentScan(basePackages = {"com.example.testtwo.dao"})

 

 

 

 
 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM