首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >DataNucleus persistence.xml筛选:在类中找不到"persistence.xml“文件

DataNucleus persistence.xml筛选:在类中找不到"persistence.xml“文件
EN

Stack Overflow用户
提问于 2012-10-18 04:50:00
回答 1查看 762关注 0票数 1

每当我启用(Maven)过滤persistence.xml文件时,我得到以下错误:

代码语言:javascript
复制
SEVERE: DataNucleus Enhancer completed with an error. Please review the enhancer log for full details. Some classes may have been enhanced but some caused errors
No "persistence.xml" files were found in the CLASSPATH yet you specified as input the name ("toto") of a "persistence-unit" to enhance. You must have a valid "persistence.xml" file in the CLASSPATH in a valid location to use this option.
org.datanucleus.enhancer.NucleusEnhanceException: No "persistence.xml" files were found in the CLASSPATH yet you specified as input the name ("toto") of a "persistence-unit" to enhance. You must have a valid "persistence.xml" file in the CLASSPATH in a valid location to use this option.
    at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:785)
    at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:525)
    at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1258)

在我的pom.xml中,我只使用了以下内容:

代码语言:javascript
复制
<resources>
    <resource>
         <filtering>true</filtering>
         <directory>src/main/resources/META-INF/</directory>
    </resource>
</resources>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-10-19 01:01:26

META-INF/应该从配置的目录元素中删除,否则在过滤了persistence.xml文件之后,Maven不会将META-INF目录放到classes文件夹中。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12943150

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档