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).
这个错误网上有很多种情况,但是我遇到的有两个:
第一种:进程占用;
这个错误是看同一个项目进程被占用,如果有的话,关闭就行。
第二种:pom文件资源配置有问题
<!-- 资源目录 --> <resources> <resource> <!-- 设定主资源目录 --> <directory>src/main/java</directory> <!-- maven default生命周期,process-resources阶段执行maven-resources-plugin插件的resources目标处理主资源目下的资源文件时,只处理如下配置中包含的资源类型 --> <includes> <include>**/*.xml</include> </includes> <!-- maven default生命周期,process-resources阶段执行maven-resources-plugin插件的resources目标处理主资源目下的资源文件时,不处理如下配置中包含的资源类型(剔除下如下配置中包含的资源类型)--> <excludes> <exclude>**/*.yml</exclude> </excludes> <!-- maven default生命周期,process-resources阶段执行maven-resources-plugin插件的resources目标处理主资源目下的资源文件时,指定处理后的资源文件输出目录,默认是${build.outputDirectory}指定的目录--> <!--<targetPath>${build.outputDirectory}</targetPath> --> <!-- maven default生命周期,process-resources阶段执行maven-resources-plugin插件的resources目标处理主资源目下的资源文件时,是否对主资源目录开启资源过滤 --> <filtering>true</filtering> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.yml</include> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources>
我出现的问题是第二种,没有配置src/main/resources这个目录的资源