SpringBoot项目新建遇到问题整理

1.新建了一个SpringBoot项目:只引用需要用到的spring boot相关的jar包,除此之外没有任何的配置

启动application.java报错:

APPLICATION FAILED TO START
***************************
Description:
Cannot determine embedded database driver class for database type NONE
Action:
If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).
--——————>原因:因为spring boot只要你在pom中引入了spring-boot-starter-data-jpa,他就会默认需要加载数据库相关的配置
你要是没有在配置文件中配置数据库相关信息,它会加载默认的配置(不存在的) 然后就报错了, 所以你要是要用数据库相关的东西 你就完善配置
不用数据库相关的东西 就不要在pom中引入相关依赖。
--------------------->解决:注释掉引用的数据库相关的jar,即可正常启动

 

 

猜你喜欢

转载自www.cnblogs.com/whhjava/p/10238102.html