首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法增强kodo JPA类

无法增强kodo JPA类
EN

Stack Overflow用户
提问于 2009-07-13 20:06:24
回答 1查看 847关注 0票数 1

我刚刚迁移到Kodo JPA版本4.2,进展并不顺利。

当我运行我的任何构建脚本(在eclipse 3.4.1中)时,我得到

代码语言:javascript
运行
复制
BUILD FAILED
D:\My Documents\eclipseWorkspaces\cnmp e341\blue ebig\ebig\src\java\build.xml:91: <openjpa-1.1.0-r422266:657916 fatal user error> org.apache.openjpa.util.MetaDataException: MetaDataFactory could not be configured (conf.newMetaDataFactoryInstance() returned null). This might mean that no configuration properties were found. Ensure that you have a META-INF/persistence.xml file, that it is available in your classpath, or that the properties file you are using for configuration is available. If you are using Ant, please see the <properties> or <propertiesFile> attributes of the task's nested <config> element. This can also occur if your OpenJPA distribution jars are corrupt, or if your security policy is overly strict.

我的build.xml位于包含persistence.xml文件的META-INF目录旁边的java目录中

下面是来自build.xml的代码片段

代码语言:javascript
运行
复制
<target name="enhance">
    <echo>base dir is ${basedir}</echo>
  <!-- define the kodoc task; this can be done at the top of the    -->
  <!-- build.xml file, so it will be available for all targets      -->
  <taskdef name="kodoc" classname="kodo.ant.PCEnhancerTask"/>

  <!-- invoke enhancer on all .jdo files below the current directory -->
  <kodoc>
    <fileset dir=".">
        <include name="**/jpa/*.java" />
        <include name="**/jpa/*.class" />
    </fileset>
    <classpath>
        <pathelement location="${basedir}"/>
    </classpath>
  </kodoc>
</target>

实体类文件位于jpa目录中。因此,目录结构如下所示:

代码语言:javascript
运行
复制
+ top
  + src
    + java
    | + com
    |   + splat
    |   | + jpa
    |   |   - entity.java 
    |   | + stuff
    |       - Object.java
    | + META-INF
    |   - persistence.xml
      - build.xml

我认为我已经按照文档中的说明进行了操作,但显然我没有。

谢谢

EN

回答 1

Stack Overflow用户

发布于 2009-07-14 14:00:52

通过将配置propertiesFile="../../config/ebig.kodo.properties"/>添加到任务中,修复了此问题

代码语言:javascript
运行
复制
  <kodoc>
    <config propertiesFile="../../config/ebig.kodo.properties"/>
    <fileset dir=".">
        <include name="**/jpa/*.java" />
        <include name="**/jpa/*.class" />
    </fileset>
    <classpath>
        <pathelement location="${basedir}"/>
    </classpath>
  </kodoc>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/1121742

复制
相关文章

相似问题

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