解决:Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource
挺长时间没看新框架了,一步步走都是坑,查询资料后说是引用了这个,但实际没有进行配置。心血来潮写了个框架吧,搭建过程中,运行居然报错。看下运行结果,图就不给了,还是不行;
·
心血来潮写了个框架吧,搭建过程中,运行居然报错。
看异常报告:
挺长时间没看新框架了,一步步走都是坑,查询资料后说是引用了这个,但实际没有进行配置
我试试配置看看在application的property这么配置能解决:
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
看下运行结果,图就不给了,还是不行;试下一个
代码
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
这个好使,代码正常运行。
更多推荐
所有评论(0)