Can confirm what IIRC Bill has mentioned before - using "-javaagent" option during integration testing with Maven breaks miserably. I created a separate Maven project with a piece of configuration like that:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-surefire-plugin</artifactId>
   <configuration>
        <forkMode>(tried all of them)</forkMode>
        <childDelegation>(tried true and false)</childDelegation>
        <argLine>-javaagent:...</argLine>
   </configuration>
</plugin>

The configuration above would load the agent, but since Maven Surefire plugin installs its own ClassLoader for the unit tests, the agent doesn't work (I saw a number of errors depending on the combination of parameters). Will probably have to do it with Ant.

Also this almost make me want to rewrite the JPA context to support true POJO's without an enhancer, as I suspect we'll be plagued by enhancer related problems in various environments. We can probably keep the enhancer as an optional extension for "Cayenne-like" behavior, including such "insignificant" things like lazy relationship loading.

Andrus

Reply via email to