Reason: Failed to determine a suitable driver class

问题如下:
在这里插入图片描述
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

原因:
经过查看上面的日志,看到设置的端口为80,但是实际上tomcat的端口为8080,也就是没有读取配置文件启动了项目。
出现这种情况的原因,大概是我这个模块是从其他的模块复制来的,然后修改了pom文件中的项目名,删掉了不需要的文件。可能导致了IDEA无法读取配置文件。

解决方法:
我使用的yml文件配置,在resources目录下添加application.properties文件,指定端口为80,启动一次,是正常启动。然后删除properties文件,就可以正常启动了。

应该是IDEA的一个bug,没有读取配置文件。遇到了问题,还是要看日志尝试解决。

本文是转载文章,点击查看原文
如有侵权,请联系 lx@jishuguiji.net 删除。