Announcement Announcement Module
Collapse
No announcement yet.
Datanucleus Plugin (Bundle) "org.datanucleus.enhancer" is already registered Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Datanucleus Plugin (Bundle) "org.datanucleus.enhancer" is already registered

    Using clean maven repositories and both mvn 3.0.4 as well as 2.2.1 I get this error.

    To reproduce:

    project --topLevelPackage com.peoplemerge.roodemo
    jpa setup --provider DATANUCLEUS --database GOOGLE_APP_ENGINE
    entity jpa --class ~.domain.Topping --testAutomatically
    field string --fieldName name --notNull --sizeMin 2
    perform tests

    The URL "file:/C:/Users/dave/.m2/repository/org/datanucleus/datanucleus-enhancer/3.0.1/datanucleus-enhancer-3.0.1.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/C:/Users/dave/.m2/repository/org/datanucleus/datanucleus-enhancer/3.1.0-m1/datanucleus-enhancer-3.1.0-m1.jar." -> [Help 1]

    I'm new to Roo but I can't find a way around this. Is this problem at datanucleus m2 repo?

  • #2
    yep

    Thanks for your quick reply and, agreed, let's look at what's in the pom that's causing this.

    I'm new to this forum so my apologies for not including a full 'mvn -X' and the pomfile as well. Somehow my attachments here are limited to 19.5k and the log and pomfile both exceed that.

    But I had the same problem on 3 different versions of maven on Windows as well as Mac, after removing ~/.m2, so unless something's changed overnight I suspect everyone trying to use roo 1.2.2.RELEASE and 1.2.1.RELEASE will get the same pomfile and see the same problem now

    Anyway here are the references to datanucleus in the pomfile (which is 100% as is unmodified from what roo spat out):
    Code:
    ...
        <repositories>
    ...
           <repository>
                <id>DataNucleus_Repos2</id>
                <url>http://www.datanucleus.org/downloads/maven2</url>
                <name>DataNucleus Repository</name>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
    ...
        </repositories>
        <pluginRepositories>
    ...
            <pluginRepository>
                <id>DataNucleus_2</id>
                <url>http://www.datanucleus.org/downloads/maven2/</url>
            </pluginRepository>
        </pluginRepositories>
        <dependencies>
    ...
    
        <dependency>
                <groupId>com.google.appengine.orm</groupId>
                <artifactId>datanucleus-appengine</artifactId>
                <version>2.0.0-final</version>
            </dependency>
            <dependency>
                <groupId>org.datanucleus</groupId>
                <artifactId>datanucleus-core</artifactId>
                <version>3.0.10</version>
            </dependency>
            <dependency>
                <groupId>org.datanucleus</groupId>
                <artifactId>datanucleus-rdbms</artifactId>
                <version>3.0.9</version>
            </dependency>
            <dependency>
                <groupId>org.datanucleus</groupId>
                <artifactId>datanucleus-api-jpa</artifactId>
                <version>3.0.9</version>
            </dependency>
    ...
        </dependencies>
        <build>
            <plugins>
    ...
                <plugin>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>maven-datanucleus-plugin</artifactId>
                    <version>3.0.2</version>
                    <configuration>
                            <fork>false</fork>
                            <log4jConfiguration>${basedir}/src/main/resources/log4j.properties</log4jConfiguration>
                            <mappingIncludes>**/*.class</mappingIncludes>
                            <verbose>true</verbose>
                            <enhancerName>ASM</enhancerName>
                            <api>JPA</api>
                        <mappingExcludes>**/CustomRequestFactoryServlet.class, **/GaeAuthFilter.class</mappingExcludes>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                                <goal>enhance</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.datanucleus</groupId>
                            <artifactId>datanucleus-core</artifactId>
                            <version>3.0.10</version>
                        </dependency>
                        <dependency>
                            <groupId>org.datanucleus</groupId>
                            <artifactId>datanucleus-api-jpa</artifactId>
                            <version>3.0.9</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
    </project>
    I'll follow up with what I can dig through the dependency it builds

    Comment


    • #3
      No apparent conflicts there... -X shows
      [DEBUG] com.google.appengine.orm:datanucleus-appengine:jar:2.0.0-final:compile
      [DEBUG] org.datanucleus:datanucleus-enhancer:jar:3.1.0-m1:compile
      [DEBUG] org.ow2.asm:asm:jar:4.0:compile
      ...

      [INFO] --- maven-datanucleus-plugin:3.0.2:enhance (default) @ roodemo ---
      [DEBUG] org.datanucleus:datanucleus-enhancer:jar:3.0.1:runtime
      [DEBUG] javax.jdo:jdo-api:jar:3.1-SNAPSHOT-20120609:runtime
      [DEBUG] javax.transaction:transaction-api:jar:1.1:runtime
      ...
      [DEBUG] Populating class realm plugin>org.datanucleus:maven-datanucleus-plugin:3.0.2
      [DEBUG] Included: org.datanucleus:maven-datanucleus-plugin:jar:3.0.2
      [DEBUG] Included: org.datanucleus:datanucleus-core:jar:3.0.10
      [DEBUG] Included: org.datanucleus:datanucleus-api-jpa:jar:3.0.9
      [DEBUG] Included: org.datanucleus:datanucleus-enhancer:jar:3.0.1
      ...
      [DEBUG] Configuring mojo org.datanucleus:maven-datanucleus-plugin:3.0.2:enhance from plugin realm ClassRealm[plugin>org.datanucleus:maven-datanucleus-plugin:3.0.2, parent: sun.misc.Launcher$AppClassLoader@f4a24a]
      [DEBUG] (f) classpathElements = [ ... C:\Users\dave\.m2\repository\org\datanucleus\datan ucleus-enhancer\3.1.0-m1\datanucleus-enhancer-3.1.0-m1.jar ...
      [DEBUG] (f) pluginArtifacts = [org.datanucleus:maven-datanucleus-plugin:maven-plugin:3.0.2:, org.datanucleus:datanucleus-core:jar:3.0.10:runtime, org.datanucleus:datanucleus-api-jpa:jar:3.0.9:runtime, org.datanucleus:datanucleus-enhancer:jar:3.0.1:runtime,
      ...
      [DEBUG] -- end configuration --
      [DEBUG] Metadata Directory is : C:\MercurialRepos\roo5\target\classes
      [INFO] CP: C:\Users\dave\.m2\repository\org\datanucleus\datan ucleus-enhancer\3.0.1\datanucleus-enhancer-3.0.1.jar
      [INFO] CP: C:\Users\dave\.m2\repository\org\datanucleus\datan ucleus-enhancer\3.1.0-m1\datanucleus-enhancer-3.1.0-m1.jar

      I don't know how to interpret all this. What do you think:

      1 Does Roo spits out a legitimate pomfile for which datanucleus dependencies should work; in that case I should move this issue to the folks at datanucleus to fix? Or,
      2 Is the pom invalid so roo or whatever magic in maven plugins springsource it calls to build the pom need fixing? Or,
      3 User error - am I doing something obviously wrong in how I'm following the documentation and need to take the Roo 101 course?

      Comment


      • #4
        Duh, if I can't post here, I can post elsewhere so here are the gory details.

        mvn -X:

        http://pastie.org/4127817
        http://pastie.org/4127820

        Complete pomfile:

        http://pastie.org/4127833

        Comment


        • #5
          Have you been able to fix this in the meanwhile, cause I'm having the same problem.
          The datanucleus enhancer is giving me a headache.
          Changing datanucleus-appengine to version 2.0.1.1 doesn't solve this either.
          Please help me out.

          Comment


          • #6
            There must still be something pulling in v3.1.0-m2. I got the following error during 'run' goal:

            >>org.datanucleus.exceptions.NucleusException: Plugin (Bundle) "org.datanucleus.enhancer" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/Users/johntroch/Documents/workspace/Recipebook/gae_version/target/recipebook-0.1.0.BUILD-SNAPSHOT/WEB-INF/lib/datanucleus-enhancer-3.1.0-m1.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/Users/johntroch/Documents/workspace/Recipebook/gae_version/target/recipebook-0.1.0.BUILD-SNAPSHOT/WEB-INF/lib/datanucleus-enhancer-3.1.0-m2.jar."

            How can I easily find what needs v3.1.0-m2 ?

            I also have the following error:

            >>ERROR org.springframework.web.context.ContextLoader - Context initialization failed
            org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'transactionManager' defined in file [/Users/johntroch/Documents/workspace/Recipebook/gae_version/target/recipebook-0.1.0.BUILD-SNAPSHOT/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory';

            Any suggestions ?

            thanks in advance,
            John
            Last edited by jonesbaking; Jul 8th, 2012, 02:10 PM. Reason: the error differs depending on the mvn goal

            Comment


            • #7
              I went through the resulting pom by hand to compare the most current versions of all the datanucleus and maven-gae-plugin with what was available from their repos. That got me past the issue in this thread. I'm attaching the resultant pomfile.

              The generated code does error in other ways on "perform tests" so I couldn't do an end-to-end test, but the problem isn't roo itself.

              Cannot have a primary key of type java.lang.Long and be a child object Child.; nested exception is javax.persistence.PersistenceException: Error in meta-data for field Child.id : Cannot have a primary key of type java.lang.Long and be a child object

              So the resulting code evidently needs massaging. Could roo be self-aware to avoid this? If I have time, I'll dig deeper open a more thorough bug report/ feature request. Meanwhile, I had to revert to non-roo to make my deadline, and I already had a steep enough learning curve having gwt issues, being new to app engine, and learning a new domain.

              Comment

              Working...
              X