Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Exception during meta-model generation in maven
Exception during meta-model generation in maven [message #556882] Fri, 03 September 2010 01:59 Go to next message
Fericit Bostan is currently offline Fericit BostanFriend
Messages: 68
Registered: June 2010
Member
I'm running in maven 2 and attempting to build with EclipseLink 2.1. I've upgraded my GlassFish server to use EclipseLink 2.1 by following these instructions:

http:// blogs.sun.com/GlassFishPersistence/entry/updating_eclipselin k_bundles_in_glassfish

I've modified my pom.xml file per the instructions that I've managed to locate.

http:// blog.gueck.com/2009/12/generating-jpa-20-criteria-canonical. html

Everything appears to build, meaning the source files get generated but the compilation fails with the following error:

Quote:

[INFO] diagnostic warning: The following options were not recognized by any processor: '[eclipselink.persistencexml]'
[ERROR] execute error
java.lang.Exception: error during compilation
at org.bsc.maven.plugin.processor.AbstractAnnotationProcessorMo jo.executeWithExceptionsHandled(AbstractAnnotationProcessorM ojo.java:233)
at org.bsc.maven.plugin.processor.AbstractAnnotationProcessorMo jo.execute(AbstractAnnotationProcessorMojo.java:124)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(Def aultPluginManager.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeG oals(DefaultLifecycleExecutor.java:678)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeG oalWithLifecycle(DefaultLifecycleExecutor.java:540)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeG oal(DefaultLifecycleExecutor.java:519)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeG oalAndHandleFailures(DefaultLifecycleExecutor.java:371)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeT askSegments(DefaultLifecycleExecutor.java:332)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute( DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:35 6)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMa in.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.ja va: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)
[INFO] ------------------------------------------------------------ ------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------ ------------
[INFO] error during compilation
[INFO] ------------------------------------------------------------ ------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: error during compilation
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeG oals(DefaultLifecycleExecutor.java:703)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeG oalWithLifecycle(DefaultLifecycleExecutor.java:540)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeG oal(DefaultLifecycleExecutor.java:519)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeG oalAndHandleFailures(DefaultLifecycleExecutor.java:371)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeT askSegments(DefaultLifecycleExecutor.java:332)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute( DefaultLifecycleExecutor.java:181)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:35 6)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMa in.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.ja va: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: error during compilation
at org.bsc.maven.plugin.processor.AbstractAnnotationProcessorMo jo.execute(AbstractAnnotationProcessorMojo.java:131)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(Def aultPluginManager.java:483)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeG oals(DefaultLifecycleExecutor.java:678)
... 17 more



My pom.xml file looks as follows:


    <properties>
                <eclipselink.version>2.0.1</eclipselink.version> 
    </properties>

    <dependencies>
        <dependency> 
            <groupId>org.eclipse.persistence</groupId> 
            <artifactId>javax.persistence</artifactId> 
            <version>2.0.0</version> 
            <scope>provided</scope> 
        </dependency> 
        <dependency> 
            <groupId>org.eclipse.persistence</groupId> 
            <artifactId>eclipselink</artifactId> 
            <version>${eclipselink.version}</version> 
            <scope>provided</scope> 
        </dependency>     

        <dependency>
            <groupId>org.glassfish.extras</groupId>
            <artifactId>glassfish-embedded-all</artifactId>
            <version>3.0.1.1</version>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <pluginRepositories>
        <pluginRepository>
            <id>maven-annotation-plugin</id>
            <url>http://maven-annotation-plugin.googlecode.com/svn/trunk/mavenrepo</url>
        </pluginRepository>
    </pluginRepositories>

   <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>1.3.5</version>
                <dependencies>
                    <dependency>
                        <groupId>org.eclipse.persistence</groupId>
                        <artifactId>javax.persistence</artifactId>
                        <version>2.0.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.eclipse.persistence</groupId>
                        <artifactId>eclipselink</artifactId>
                        <version>${eclipselink.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>JPA Metamodel Generation</id>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <outputDirectory>${project.build.directory}/generated-sources/apt</outputDirectory>
                            <compilerArguments>-Aeclipselink.persistencexml=src/main/resources/META-INF/persistence.xml</compilerArguments>
                            <processors>
                                <processor>org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor</processor>
                            </processors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>JPA Enhancement</id>
                        <phase>process-classes</phase>
                        <configuration>
                            <tasks>
                                <java
                                    classname="org.eclipse.persistence.tools.weaving.jpa.StaticWeave"
                                    classpathref="maven.test.classpath"
                                    fork="true">
                                    <arg
                                        line="-loglevel FINEST -persistenceinfo src/main/resources target/classes target/classes" />
                                </java>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>



Can anyone see a reason as to why I am unable to compile successfully?

Thanks very much for the help....
Re: Exception during meta-model generation in maven [message #557010 is a reply to message #556882] Fri, 03 September 2010 15:45 Go to previous message
Fericit Bostan is currently offline Fericit BostanFriend
Messages: 68
Registered: June 2010
Member
I resolved my problem. The issue was the version of EclipseLink that I had specified in my pom.xml. Version 2.0.1 has an issue with the meta-model generation and, in fact, I wanted to be using version 2.1.1. Once I changed to 2.1.1 everything compiled correctly.

Just make certain that you include the correct EclipseLink repository.


        <repository>
            <id>EclipseLink Repo</id>
            <name>EclipseLink Repository for the JPA implementation</name>
            <url>http://www.eclipse.org/downloads/download.php?r=1&amp;nf=1&amp;file=/rt/eclipselink/maven.repo</url>
        </repository>        

Previous Topic:Fetch strategy tips
Next Topic:eclispselink doesn't generate primary key constraint [@ElementCollection]
Goto Forum:
  


Current Time: Fri Nov 28 08:53:00 GMT 2014

Powered by FUDForum. Page generated in 0.05294 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software