报错解决:Reason: Failed to determine a suitable driver class

简介: 报错解决:Reason: Failed to determine a suitable driver class

背景:

导入别人的项目,却报错:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-05-06 23:35:15.267 ERROR 12944 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
***************************
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
Action:
Consider the following:
  If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
  If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
Process finished with exit code 1



这是一个常见的问题,如果试了很多都不行,可能是这个原因,以下是没解决前截图:


image.png


注意看:

1、 resources 其实只是一个普通的文件夹而已

2、配置文件里, spring.datasource.url 是灰色的,而 spring.datasource.password 却是有颜色的


解决步骤:右击 resources 文件夹,然后选择 Mark Directory as ,然后选择 Resources Root 即可:


image.png


修改好之后:


image.png


这样就不会报错了!


其他参考文章:

https://blog.csdn.net/ht_kasi/article/details/82259860?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-82259860-blog-118083303.pc_relevant_antiscanv2&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-1-82259860-blog-118083303.pc_relevant_antiscanv2&utm_relevant_index=1


相关文章
|
5月前
|
网络协议 网络安全 数据库
|
7月前
|
安全 Java 应用服务中间件
A configuration error occurred during startup.Please verify the preference field with the prompt: To
A configuration error occurred during startup.Please verify the preference field with the prompt: To
|
Java 数据库连接 数据库
【Java异常】Failed to determine a suitable driver class
【Java异常】Failed to determine a suitable driver class
475 0
解决办法:configure: error: You requested SRTP (requires libsrtp) but not found...die
解决办法:configure: error: You requested SRTP (requires libsrtp) but not found...die
147 0
|
并行计算 PyTorch 算法框架/工具
CUDA unknown error - this may be due to an incorrectly set up environment 问题解决
CUDA unknown error - this may be due to an incorrectly set up environment 问题解决
CUDA unknown error - this may be due to an incorrectly set up environment 问题解决
|
应用服务中间件 Android开发
a configuration error occurred during startup. place verify the preference field whth the prompt:TomcatJDK name:
a configuration error occurred during startup. place verify the preference field whth the prompt:TomcatJDK name:
144 0
a configuration error occurred during startup. place verify the preference field whth the prompt:TomcatJDK name:
|
Go iOS开发
The operation couldn’t be completed. Unable to log in with account 'myappleid'. An unexpected failure occurred while logging in (Underlying error code 1100).解决方法
The operation couldn’t be completed. Unable to log in with account 'myappleid'. An unexpected failure occurred while logging in (Underlying error code 1100).解决方法
482 0
|
SQL Java 关系型数据库
hive_异常_01_ Terminal initialization failed; falling back to unsupported
一、异常现象 hive初始化数据库时,在执行了 schematool -initSchema -dbType mysql 这个命令时,终端抛出如下异常: [ray@rayner bin]$ schematool -initSchema -dbType mysql Met...
1956 0
Starting a Gradle Daemon, 5 busy and 1 incompatible and 1 stopped Daemons could not be reused, use --status for details FAILURE: Build failed with an
执行gradle build出的问题,查看hs_err_pid11064.log日志文件发现,是电脑的RAM不足导致
4160 0
|
分布式计算 资源调度 Java
[ERROR] Terminal initialization failed; falling back to unsupported java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface
1:出现此种错误应该是jar版本包冲突了,启动hive的时候,由于hive依赖hadoop,启动hive,会将hadoop的配置以及jar包等等导入到hive中,导致jar包版本冲突,下面贴一下错误,然后贴一下解决方法: 1 [root@master bin]# .
1607 0