【问题标题】:Spring JPA Hibernate Maven - Error : No persistence units parsed from {classpath*:META-INF/persistence.xml}Spring JPA Hibernate Maven - 错误:没有从 {classpath*:META-INF/persistence.xml} 解析的持久性单元
【发布时间】:2011-02-04 08:41:50
【问题描述】:

在测试 Getting Started With JPA in Spring 2.0 教程中创建的应用程序时,我收到以下错误。我在 Eclipse 中创建了 Maven 项目。这是项目结构的一部分

ecotraveler
   src
      main
         java
             com
                enam
         resources
             config
                   applicationContext.xml
   WebContent
       META-INF
           persistance.xml

在运行测试类时,我收到了No persistence units parsed from {classpath*:META-INF/persistence.xml}

谁能告诉我可能是什么问题?似乎应用程序无法找到指定的路径。我仔细检查了 WebContet/META-INF 是否在 Eclipse 构建路径中。

【问题讨论】:

标签: eclipse hibernate spring jpa maven


【解决方案1】:

您需要将 META-INF 目录放在资源目录中,而不是在 WebContent 中

【讨论】:

    【解决方案2】:

    你拼错了“persistence.xml”;它没有“a”

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-10-02
      • 2012-07-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-21
      • 1970-01-01
      相关资源
      最近更新 更多