2009-07-13 55 views
1

我只是轉向Kodo JPA 4.2版,並不順利。無法增強kodo JPA類

,當我跑我的任何構建腳本(在Eclipse 3.4.1)我得到

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坐在我的java目錄我旁邊的META-INF目錄中包含我的persistence.xml文件

這裏距離的build.xml

<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目錄中的片段。因此,目錄結構如下:

+ top 
    + src 
    + java 
    | + com 
    | + splat 
    | | + jpa 
    | | - entity.java 
    | | + stuff 
    |  - Object.java 
    | + META-INF 
    | - persistence.xml 
     - build.xml 

我原以爲我曾跟隨在文檔的方向,但顯然我沒有。

感謝

回答

0

此問題已修復通過添加配置propertiesFile = 「../../配置/ ebig.kodo.properties」/> 到現在看起來

<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

任務是什麼你有`ebig.kodo.properties`嗎? – expert 2011-12-20 11:42:10