openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sudhakar <sudha...@co.brazos.tx.us>
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:
enhance.xml
src
src\META-INF
src\META-INF\persistence.xml

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"
classname="org.apache.openjpa.ant.PCEnhancerTask">
            <classpath>
                <pathelement
location="C:/libraries/openjpa/current/openjpa.jar" />
                <pathelement
location="C:/libraries/openjpa/current/commons-lang-2.1.jar" />
                <pathelement
location="C:/libraries/openjpa/current/geronimo-jta_1.0.1B_spec-1.0.1.jar"
/>
                <pathelement
location="C:/libraries/openjpa/current/geronimo-j2ee-connector_1.5_spec-1.0.1.jar"
/>
                <pathelement
location="C:/libraries/openjpa/current/serp-1.11.0.jar" />
            </classpath>
        </taskdef>

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


Here is my persistence.xml

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    version="1.0">
    <persistence-unit name="voterPU"
        transaction-type="RESOURCE_LOCAL">
        <provider>
            org.apache.openjpa.persistence.PersistenceProviderImpl
        </provider>
        <class>brazos.voter.client.lib.domain.Voter</class>
        <properties>
            <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" />
        </properties>
    </persistence-unit>
</persistence>

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.
-sud

Mime
View raw message