openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ben short" <jamin.sh...@gmail.com>
Subject Re: Please help me enhancing my classes
Date Wed, 24 Oct 2007 09:00:34 GMT
Hi,

Here is what I have in my pom...

<repositories>
        <repository>
            <id>Codehaus Snapshots</id>
            <url>http://snapshots.repository.codehaus.org/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
        <repository>
            <id>apache-snapshots</id>
            <url>http://people.apache.org/repo/m2-snapshot-repository</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>Codehaus Snapshots</id>
            <url>http://snapshots.repository.codehaus.org/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>


<plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <configuration>
                            <tasks>
                                <java
classname="org.apache.openjpa.enhance.PCEnhancer"
                                      classpathref="maven.runtime.classpath"
                                      dir="target/classes" fork="true"/>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>


Also if you want to see the output of the enhancer, you'll need to
setup your persistence.xml as follows...

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
		version="1.0">

    <persistence-unit name="openjpa" transaction-type="RESOURCE_LOCAL">

    <properties>
       <property name="openjpa.Log" value="DefaultLevel=TRACE, Tool=TRACE"/>
    </properties>
  </persistence-unit>

</persistence>





On 10/24/07, Julien Martin <balteo@gmail.com> wrote:
> Hello,
>
> I am having problems enhancing my classes. I have tried this: This runs
> successfully but nothing is produced. My classes are not altered.
>
> <plugin>
>                 <artifactId>maven-antrun-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <phase>process-classes</phase>
>                         <configuration>
>                             <tasks>
>                                 <java classname="
> org.apache.openjpa.enhance.PCEnhancer"
>                                       classpathref="maven.runtime.classpath"
>                                       dir="target/classes"
>                                       fork="false"
>                                       failonerror="true">
>                                           <classpath>
>                                               <pathelement
> location="src/main/resources/META-INF/persistence.xml"/>
>                                           </classpath>
>                                  </java>
>                             </tasks>
>                         </configuration>
>                         <goals>
>                             <goal>run</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>             </plugin>
>
>
> I have also tried this:
>
> <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>
> <artifactId>openjpa-maven-plugin</artifactId>
>                 <executions>
>                     <execution>
>                         <id>JPA Enhance</id>
>                         <phase>process-classes</phase>
>                         <goals>
>                             <goal>enhance</goal>
>                         </goals>
>                     </execution>
>                 </executions>
>                 <configuration>
>                     <classpathElements>
>                         <classpathElement>
>
> C:\\dev\\calyonfinancial\CdR\src\main\resources\META-INF\persistence.xml
>                         </classpathElement>
>                     </classpathElements>
>                     <toolProperties>
>                         <property>
>                             <name>addDefaultConstructor</name>
>                             <value>true</value>
>                         </property>
>                         <property>
>                             <name>enforcePropertyRestrictions</name>
>                             <value>true</value>
>                         </property>
>                     </toolProperties>
>                 </configuration>
>             </plugin>
>
> Which fails and gives the following error message:
>
> -----------------------------------------------------------------------
> [ERROR]BUILD ERROR
> ------------------------------------------------------------------------
> The OpenJPA Enhancer tool exited with a non-null exit code.
> ------------------------------------------------------------------------
> Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: The OpenJPA Enhancer
> tool exited with a non-null exit code.
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:564)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(
> DefaultLifecycleExecutor.java:493)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
> DefaultLifecycleExecutor.java:463)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
> (DefaultLifecycleExecutor.java:311)
>         at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
> DefaultLifecycleExecutor.java:278)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
> DefaultLifecycleExecutor.java:143)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java
> :315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java
> :430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: The OpenJPA
> Enhancer tool exited with a non-null exit code.
>         at org.codehaus.mojo.openjpa.OpenJpaEnhancerMojo.enhance(
> OpenJpaEnhancerMojo.java:248)
>         at org.codehaus.mojo.openjpa.OpenJpaEnhancerMojo.execute(
> OpenJpaEnhancerMojo.java:105)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
> DefaultPluginManager.java:443)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:539)
>         ... 16 more
> ------------------------------------------------------------------------
> Total time: 5 seconds
> Finished at: Wed Oct 24 10:39:10 CEST 2007
> Final Memory: 5M/11M
> ------------------------------------------------------------------------
>
> Can anyone please help?
>
> Thanks in advance,
>
> Julien.
>

Mime
View raw message