报错信息:
***************************
APPLICATION FAILED TO START
***************************
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
今天公司准备使用websocket,所以学习了下,新建了springboot项目来做一个小demo,但是呢项目建完了代码搞完一直启动不来
为什么呢?
经过排查错误发现是我建项目时候增加了数据源这块,但是我在项目配置文件中有没有应用,所以启动时候一直去扫描
数据源
解决方案:
1.在配置文件里面,配置数据源
2.如果不需要使用到数据库的话,可以直接在启动类增加注解:
自动配置
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})