• embedded database (H2, HSQL or Derby), please put it on the classpath


    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这个目录的资源

  • 相关阅读:
    docker 容器使用 systemctl 命令报错
    lxml 这个包和openpyxl 起冲突
    解决GPG error: The following signatures couldn't be verified because the public key is not available
    pyinstaller bug
    PyCharm使用技巧及常用快捷键
    python 软件目录规范
    Wpf canvas 绘图 像素对齐
    wpf ListView 隔行 (各行) 显示 不同 背景 颜色
    C# wpf 获取 数字 类型 所占字节数
    Mybatis-Plus QueryWrapper +sql自定义查询
  • 原文地址:https://www.cnblogs.com/perferect/p/12515529.html
Copyright © 2020-2023  润新知