Since you're using Eclipse, maybe taking a look at the experimental Eclipse plugin for OpenJPA 1.2 would help?

http://people.apache.org/~ppoddar/eclipse/


-Donald


[email protected] wrote:
Hello everybody,

I have got another problem. This time it is a problem with runtime enhancement.

I am enhancing my classes with the following ant script started from Eclipse:

<project name="jpa_enhance_builder">
        
        <path id="enhance.cp">
                <pathelement location="${basedir}${file.separator}bin"/>
                
                <fileset dir="${basedir}${file.separator}lib/OpenJPA_1.2.1">
                        <include name="**/*.jar"/>
                </fileset>
        </path>
        
        <path id="compile.classpath">
                <fileset dir="${basedir}${file.separator}/lib">
                        <include name="**/*.jar"/>
                </fileset>
                
                <fileset dir="C:\GhostTO\workspace\XFTu\bin">
                        <include name="**/*.class"/>
                </fileset>
                
                <fileset dir="${src}">
                        <include name="**/*.class"/>
                </fileset>
        </path>
        
        <property name="cp" refid="enhance.cp"/>
        <property name="src" value="${basedir}${file.separator}src"/>
        <property name="bin" value="${basedir}${file.separator}bin"/>

        
        <target name="enhance">
                <echo message="${cp}"/>
                <taskdef name="openjpac" 
classname="org.apache.openjpa.ant.PCEnhancerTask">
                        <classpath refid="enhance.cp"/>
                </taskdef>
                <openjpac>
                        <classpath refid="enhance.cp"/>
                        <config 
propertiesFile="./src/META-INF/persistence.xml"/>
                    <fileset dir="${src}">
                      <include name="**/entities/*.java" />
                    </fileset>
                </openjpac>
        </target>
</project>

The build runs without any problems and with setting openjpa.Log = TRACE it 
seems that all classes are enhanced. But if I run my application, I still get 
the message:

Creating subclass for "[...]". This means that your application will be less 
efficient and will consume more memory than it would if you ran the OpenJPA enhancer. 
Additionally, lazy loading will not be available for one-to-one and many-to-one 
persistent attributes in types using field access; they will be loaded eagerly instead.

Any ideas?
Can it be that Eclipse is somehow overwriting my enhanced classes on startup?

Reply via email to