title: org.apache.openjpa.util.MetaDataException while build time enhancing using ANT
body: <p>I am using OpenJPA's build time enhancement using ANT. Here is the project structure</p>
  
  <pre><code>TestOpenJPA
  + src
  | + in
  | | + ns
  | | | xxx.java
  | + META-INF
  | | persistence.xml
  + build
  + dist
  + OpenJPA_lib_jar
  | openjpa-all-2.2.0.jar
  + build.xml
  </code></pre>
  
  <p>Here is the enhancement snippet code from <code>build.xml</code> file</p>
  
  <pre><code>    &lt;!-- Define the classpath to include the necessary files. --&gt;
  &lt;!-- ex. openjpa jars, persistence.xml, orm.xml, and target classes  --&gt;
  &lt;path id="jpa.enhancement.classpath"&gt;
      &lt;!-- Assuming persistence.xml/orm.xml are in META-INF --&gt;
      &lt;pathelement location="META-INF" /&gt;
  
      &lt;!-- Location of the .class files --&gt;
      &lt;pathelement location="build/classes" /&gt;
  
      &lt;!-- Add the openjpa jars --&gt;
      &lt;fileset dir="OpenJPA_lib_jar"&gt;
              &lt;include name="*.jar" /&gt;
      &lt;/fileset&gt;
  &lt;/path&gt;
  &lt;!-- define the openjpac task; this can be done at the top of the --&gt;
  &lt;!-- build.xml file, so it will be available for all targets --&gt;
  &lt;taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="jpa.enhancement.classpath" /&gt;
  
  &lt;!-- invoke enhancer on all .class files below the model directory --&gt;
  &lt;openjpac&gt;
      &lt;classpath refid="jpa.enhancement.classpath" /&gt;
      &lt;fileset dir="."&gt;
          &lt;include name="**/model/*.class" /&gt;
      &lt;/fileset&gt;
  &lt;/openjpac&gt;
  &lt;echo message="Enhancement complete" /&gt;
  </code></pre>
  
  <p>When I build the project in eclipse (indigo) I get following exception in the output.</p>
  
  <pre><code>[openjpac] &lt;openjpa-2.2.0-r422266:1244990 fatal user error&gt; 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 &lt;properties&gt; or &lt;propertiesFile&gt; attributes of the task's nested &lt;config&gt; element. This can also occur if your OpenJPA distribution jars are corrupt, or if your security policy is overly strict.
  [openjpac]  at org.apache.openjpa.meta.MetaDataRepository.initializeMetaDataFactory(MetaDataRepository.java:1904)
  [openjpac]  at org.apache.openjpa.meta.MetaDataRepository.endConfiguration(MetaDataRepository.java:1885)
  [openjpac]  at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:518)
  [openjpac]  at org.apache.openjpa.lib.conf.Configurations.configureInstance(Configurations.java:443)
  [openjpac]  at org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:104)
  [openjpac]  at org.apache.openjpa.conf.MetaDataRepositoryValue.instantiate(MetaDataRepositoryValue.java:68)
  [openjpac]  at org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83)
  [openjpac]  at org.apache.openjpa.conf.OpenJPAConfigurationImpl.newMetaDataRepositoryInstance(OpenJPAConfigurationImpl.java:968)
  [openjpac]  at org.apache.openjpa.ant.PCEnhancerTask.executeOn(PCEnhancerTask.java:88)
  [openjpac]  at org.apache.openjpa.lib.ant.AbstractTask.execute(AbstractTask.java:171)
  [openjpac]  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
  [openjpac]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [openjpac]  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  [openjpac]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  [openjpac]  at java.lang.reflect.Method.invoke(Unknown Source)
  [openjpac]  at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
  [openjpac]  at org.apache.tools.ant.Task.perform(Task.java:348)
  [openjpac]  at org.apache.tools.ant.Target.execute(Target.java:390)
  [openjpac]  at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180)
  [openjpac]  at org.eclipse.ant.internal.core.ant.InternalAntRunner.parseBuildFile(InternalAntRunner.java:348)
  [openjpac]  at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:634)
  [openjpac]  at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:496)
  [openjpac]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [openjpac]  at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  [openjpac]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  [openjpac]  at java.lang.reflect.Method.invoke(Unknown Source)
  [openjpac]  at org.eclipse.ant.core.AntRunner.run(AntRunner.java:378)
  [openjpac]  at org.eclipse.ant.internal.launching.launchConfigurations.AntLaunchDelegate.runInSameVM(AntLaunchDelegate.java:321)
  [openjpac]  at org.eclipse.ant.internal.launching.launchConfigurations.AntLaunchDelegate.launch(AntLaunchDelegate.java:274)
  [openjpac]  at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
  [openjpac]  at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
  [openjpac]  at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:696)
  [openjpac]  at org.eclipse.core.externaltools.internal.model.ExternalToolBuilder.launchBuild(ExternalToolBuilder.java:181)
  [openjpac]  at org.eclipse.core.externaltools.internal.model.ExternalToolBuilder.doBuildBasedOnScope(ExternalToolBuilder.java:169)
  [openjpac]  at org.eclipse.core.externaltools.internal.model.ExternalToolBuilder.build(ExternalToolBuilder.java:88)
  [openjpac]  at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
  [openjpac]  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
  [openjpac]  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
  [openjpac]  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
  [openjpac]  at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
  [openjpac]  at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
  [openjpac]  at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
  [openjpac]  at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
  [openjpac]  at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
  [openjpac]  at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
  [openjpac]  at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
  [openjpac]  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
  
  BUILD FAILED
  </code></pre>
  
  <p>Can anyone let me know what is</p>