• <bdo id='nsNIc'></bdo><ul id='nsNIc'></ul>

      <small id='nsNIc'></small><noframes id='nsNIc'>

      <legend id='nsNIc'><style id='nsNIc'><dir id='nsNIc'><q id='nsNIc'></q></dir></style></legend>
      <i id='nsNIc'><tr id='nsNIc'><dt id='nsNIc'><q id='nsNIc'><span id='nsNIc'><b id='nsNIc'><form id='nsNIc'><ins id='nsNIc'></ins><ul id='nsNIc'></ul><sub id='nsNIc'></sub></form><legend id='nsNIc'></legend><bdo id='nsNIc'><pre id='nsNIc'><center id='nsNIc'></center></pre></bdo></b><th id='nsNIc'></th></span></q></dt></tr></i><div id='nsNIc'><tfoot id='nsNIc'></tfoot><dl id='nsNIc'><fieldset id='nsNIc'></fieldset></dl></div>

      1. <tfoot id='nsNIc'></tfoot>

        在 Maven 测试期间未找到 persistence.xml

        时间:2023-10-01
      2. <legend id='FtJtF'><style id='FtJtF'><dir id='FtJtF'><q id='FtJtF'></q></dir></style></legend>
        <i id='FtJtF'><tr id='FtJtF'><dt id='FtJtF'><q id='FtJtF'><span id='FtJtF'><b id='FtJtF'><form id='FtJtF'><ins id='FtJtF'></ins><ul id='FtJtF'></ul><sub id='FtJtF'></sub></form><legend id='FtJtF'></legend><bdo id='FtJtF'><pre id='FtJtF'><center id='FtJtF'></center></pre></bdo></b><th id='FtJtF'></th></span></q></dt></tr></i><div id='FtJtF'><tfoot id='FtJtF'></tfoot><dl id='FtJtF'><fieldset id='FtJtF'></fieldset></dl></div>

        <small id='FtJtF'></small><noframes id='FtJtF'>

            <tbody id='FtJtF'></tbody>
          <tfoot id='FtJtF'></tfoot>
            • <bdo id='FtJtF'></bdo><ul id='FtJtF'></ul>
                • 本文介绍了在 Maven 测试期间未找到 persistence.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试在 Maven 构建期间将测试数据加载到测试数据库中以进行集成测试.persistence.xml 被正确复制到 target/test-classes/META-INF/,但是在运行测试时出现此异常.

                  I'm trying to load test data into a test DB during a maven build for integration testing. persistence.xml is being copied to target/test-classes/META-INF/ correctly, but I get this exception when the test is run.

                  javax.persistence.PersistenceException:没有持久性提供程序EntityManager 命名为目标数据库

                  javax.persistence.PersistenceException: No Persistence provider for EntityManager named aimDatabase

                  它似乎没有找到或加载persistence.xml.

                  It looks like it's not finding or loading persistence.xml.

                  推荐答案

                  刚刚用一个基于 Maven/Eclipse 的 JPA 项目解决了同样的问题.

                  Just solved the same problem with a Maven/Eclipse based JPA project.

                  我的 META-INF 目录位于 src/main/java 下,因为在测试阶段之前它没有复制到目标目录.

                  I had my META-INF directory under src/main/java with the concequence that it was not copied to the target directory before the test phase.

                  将此目录移动到 src/main/resources 解决了问题,并确保 META-INF/persistence.xml 文件存在于 target/classes 运行测试的时间.

                  Moving this directory to src/main/resources solved the problem and ensured that the META-INF/persistence.xml file was present in target/classes when the tests were run.

                  认为 JPA 方面将我的 META-INF/persistence.xml 文件放在 src/main/java 中,结果证明成为我问题的根源.

                  I think that the JPA facet put my META-INF/persistence.xml file in src/main/java, which turned out to be the root of my problem.

                  这篇关于在 Maven 测试期间未找到 persistence.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:保存文件后自动启动单元测试 下一篇:如何生成源代码来创建我正在调试的对象?

                  相关文章

                  最新文章

                  <legend id='2F4qb'><style id='2F4qb'><dir id='2F4qb'><q id='2F4qb'></q></dir></style></legend>

                    <tfoot id='2F4qb'></tfoot>
                    <i id='2F4qb'><tr id='2F4qb'><dt id='2F4qb'><q id='2F4qb'><span id='2F4qb'><b id='2F4qb'><form id='2F4qb'><ins id='2F4qb'></ins><ul id='2F4qb'></ul><sub id='2F4qb'></sub></form><legend id='2F4qb'></legend><bdo id='2F4qb'><pre id='2F4qb'><center id='2F4qb'></center></pre></bdo></b><th id='2F4qb'></th></span></q></dt></tr></i><div id='2F4qb'><tfoot id='2F4qb'></tfoot><dl id='2F4qb'><fieldset id='2F4qb'></fieldset></dl></div>
                      <bdo id='2F4qb'></bdo><ul id='2F4qb'></ul>
                  1. <small id='2F4qb'></small><noframes id='2F4qb'>