Не могу улучшить классы кодо JPA - PullRequest
1 голос
/ 14 июля 2009

Я просто перехожу на Kodo JPA версии 4.2, и она не идет гладко.

при запуске любого сценария сборки (в 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

Я думал, что следовал инструкциям в документе, но ясно, что не сделал.

Спасибо

1 Ответ

0 голосов
/ 14 июля 2009

Эта проблема была исправлена ​​добавлением config propertiesFile = "../../ config / 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>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...