tags:

views:

238

answers:

1

I am just moving to Kodo JPA version 4.2 and it isn't going smoothly.

when I run my any build script (in eclipse 3.4.1) I get

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.

My build.xml is sitting in my java directory next to my META-INF directory containing my persistence.xml file

here is the snippet from the 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>

The entity class files are in the jpa directory. So the directory structure looks like this:

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

I had thought I had followed the directions in the doc., but clearly I didn't.

Thanks

A: 

This problem was fixed by adding config propertiesFile="../../config/ebig.kodo.properties"/> to the task it now looks like

  <kodoc>
   <config propertiesFile="../../config/ebig.kodo.properties"/>
    <fileset dir=".">
     <include name="**/jpa/*.java" />
     <include name="**/jpa/*.class" />
    </fileset>
   <classpath>
    <pathelement location="${basedir}"/>
   </classpath>
  </kodoc>
Aaron