Kevin,

Thanks for your reply, I changed the RuntimeUnhenhancedClasses to
unsupported as you suggested and I did get the error message stating
that my a number of my classes were not enhanced.  So does this mean
that the javaagent is not working correctly?  I am specifying it in my
maven pom.xml when the maven-surefire plugin is called with the
following:


<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
                <forkMode>once</forkMode>
        
<argLine>-javaagent:${project.build.directory}/openejb-javaagent-3.0.jar
</argLine>
                <systemProperties>
                        <property>
        
<name>net.sourceforge.cobertura.datafile</name>
        
<value>target/cobertura/cobertura.ser</value>
                        </property>
                        <property>
                                <name>pom.version</name>
                                <value>${pom.version}</value>
                        </property>
                        <property>
                                <name>appserver</name>
                                <value>${appserver}</value>
                        </property>
                </systemProperties>
        </configuration>
</plugin>



I have also got the openejb jar file being copied to the required
location earlier on in the build.

I will have a look at producing a testcase to demonstrate this today.

Thanks

Gareth


-----Original Message-----
From: Kevin Sutter [mailto:[EMAIL PROTECTED] 
Sent: 16 July 2008 15:46
To: [email protected]
Subject: Re: Problem with openjpa enhancer - using runtime enhancement

Gareth,
 Recently, I found an obscure problem with the IBM JDK when using the
javaagent enhancement, but I don't see how this would apply to this
situation. You end up with a nasty exception from the Java runtime, and
I would think you would have mentioned that...

Other than than, I am not aware of any differences between the two forms
of enhancement.

One idea is to ensure that the -javaagent is really taking effect.
Besides these two enhancement mechanisms, there is a third fallback
mechanism. This fallback mechanism is not quite "ready for production"
and I would recommend turning it off. We do that for WebSphere.

openjpa.RuntimeUnenhancedClasses=unsupported  (along with your
-javaagent
setting)

This can be specified as a property in their persistence.xml or as a
java command line parameter (-Dxxx=yyy).

If you are accidentally falling into this third style of enhancement,
then you will get an error about a particular entity not being enhanced
and your processing will quit.  At least this will show whether you are
using your -javaagent like you expected.

Do you have a simple testcase that you could share to demonstrate the
problem?

Thanks,
Kevin


On Wed, Jul 16, 2008 at 4:34 AM, Gareth Davies
<[EMAIL PROTECTED]>
wrote:

> Hi
>
> Openjpa 1.1.0
>
> I am having a problem with runtime enhancement on my persistent 
> entities.  Runtime enhancement completes during my test phase using 
> the openejb 3.0 javaagent, but when the unit tests run I have problems

> relating to merges using the entityManager.  The id field does not 
> seem to be generated correctly it seems to be giving it a 0 value 
> rather than the next available id and it doesn't actually seem to be 
> inserting into the database.  I have tried the same build process 
> using build time enhancement and all the tests pass (I would use build

> time enhancement but having tried it during the build with the 
> openjpa-maven-plugin, which seems to only support openjpa 0.9.6, my 
> command line is too long ~16100 characters and Windows limit is 8192, 
> I had to resort to a batch file).
>
> Has anyone else had any issues with this, or are there difference 
> between runtime and build time enhancement that are causing these 
> failures.
>
> Also if anyone has any ideas about getting the build time enhancement 
> to run as part of a maven build without using the openjpa-maven-plugin

> that would be great.
>
> Thanks
>
> Gareth Davies
>

Reply via email to