Hi Sebastian,
I took a look at the previous thread where you were having problems with a
missing class definition. I think you'll want something like this:
<?xml version="1.0" encoding="UTF-8"?>
<project name="build" default="enhance" basedir=".">
<path id="build.classpath">
<fileset dir="jar">
<include name="*.jar" />
</fileset>
</path>
<path id="entity.classpath">
<pathelement location="build"/> <!-- assuming your entities are
compiled to the build sub-directory -->
</path>
<path id="persistence.classpath">
<pathelement location="../Persistence/build"/> <!-- assuming the
persistence project builds to its build sub-directory -->
</path>
<path id="openjpa.classpath">
<pathelement location="${path.to.openjpa.jar}"/>
<!-- pathelements for commons-lang, commons-pool, and other
dependencies go here -->
</path>
<target name="enhance">
<java classname="org.apache.openjpa.enhance.PCEnhancer"
fork="true" failonerror="true">
<arg value="-p"/>
<arg
value="../Persistence/src/META-INF/persistence.xml"/>
<classpath>
<path refid="entity.classpath"/>
<path refid="persistence.classpath"/>
<path refid="openjpa.classpath"/>
</classpath>
</java>
</target>
</project>
You'll need to put the entities and openjpa jars on the classpath. It looks
like one or more of your entities depends on a class from the Persistence
project - which is why you got a NoClassDefFoundError earlier, so you'll
need to add that too.
Hope this helps,
-Mike
On Feb 2, 2008 1:51 PM, Sebastian Souza <[EMAIL PROTECTED]> wrote:
> Please, this my last chance. I were writing to forums but nobody could
> help
> me with my problem.
>
> i couldnt ran the enhancer in my application and my performance is
> horrible.
>
>
> i try to build my entities classes but the enhancer couldnt find them.
>
> My scenario is:
>
> I only use orm.xml and persistence.xml (i dont use attributes in my
> classes).
>
> I have a persistence project where the persistence.xml and orm.xml resides
> Then i have my entities projects where i put my entities
>
> my build.xml in the entities project is
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project name="build" default="enhance" basedir=".">
> <path id="build.classpath">
> <fileset dir="jar">
> <include name="*.jar" />
> </fileset>
> </path>
> <target name="enhance">
> <java classname="org.apache.openjpa.enhance.PCEnhancer"
> fork="true" failonerror="true">
> <arg value="-p"/>
> <classpath refid="build.classpath"/>
> <arg
> value="../Persistence/src/META-INF/persistence.xml"/>
> <classpath>
> <pathelement path="${java.class.path}"/>
> <pathelement
> location="../Persistence/src/META-INF/"/>
> </classpath>
> </java>
> </target>
> </project>
>
> the result:
>
> [java] 343 ITSM INFO [main] openjpa.Tool - No targets were given.
> Running on all classes in your persistent classes list, or all metadata
> files in classpath directories if you have not listed your persistent
> classes. Use -help to display tool usage information.
> [java] 1421 ITSM WARN [main] openjpa.Tool - Found no class to
> enhance.
>
> i would appreciate any help you can give me
> regards
>