openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sudhakar <>
Subject build time enhancement in an eclipse plug-in project
Date Sat, 18 Aug 2007 21:53:35 GMT
Being unable to get the runtime enhancement working with my Eclipse
plug-in project I decided to try the build time enhancement. And am
running into some issues:

My project is an eclipse plug-in project with the following structure:

Here is my enhance.xml ant build file
<project name="brazos.voter.client" default="enhance">

    <target name="enhance">
        <!-- define the openjpac task; this can be done at the top of
the    -->
        <!-- build.xml file, so it will be available for all
targets      -->
        <taskdef name="openjpac"
location="C:/libraries/openjpa/current/openjpa.jar" />
location="C:/libraries/openjpa/current/commons-lang-2.1.jar" />
location="C:/libraries/openjpa/current/serp-1.11.0.jar" />

            <fileset dir=".">
                <include name="**/domain/*.java" />
            <!-- <config properties="bin/META-INF/persistence.xml" /> -->

Here is my persistence.xml

<persistence xmlns=""
    <persistence-unit name="voterPU"
            <property name="openjpa.ConnectionDriverName"
                value="org.apache.derby.jdbc.EmbeddedDriver" />
            <property name="openjpa.ConnectionFactoryProperties"
                value="QueryTimeout=5000" />
            <property name="openjpa.ConnectionURL"
                value="jdbc:derby:C:/Elections/VoterDB" />
            <property name="openjpa.ConnectionUserName" value="app" />
            <property name="openjpa.ConnectionPassword" value="" />
            <property name="openjpa.Log" value="DefaultLevel=TRACE" ,
                Tool="INFO" , Runtime="TRACE" />

I added the ant builder to the project properties and added the bin
folder to the classpath for the ant builder.

When I launch my RCP application with the plugin I get an Ant Build
Failed dialog with the following message:

"org.apache.openjpa.util.MetaDataException: MetaDataFactory count 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 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 <cofig> element. This can also occur if
your OpenJPA distribution jars are corrupt, or if your security policy
is overly strict."

I've tried adding the following to the openjpac tag in the enhance.xml

<config properties="bin/META-INF/persistence.xml" />
<config properties="META-INF/persistence.xml" />
<config properties="src/META-INF/persistence.xml" />
<config propertiesFile="bin/META-INF/persistence.xml" />
<config propertiesFile="META-INF/persistence.xml" />
<config propertiesFile="src/META-INF/persistence.xml" />

None of this has fixed the issue. I'd appreciate any help getting this
to work.

View raw message