Results 1 to 10 of 12

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

Hybrid View

  1. #1
    Join Date
    Jun 2012
    Posts
    5

    Default 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?
    Attached Files Attached Files

  2. #2

    Default

    Why not address why you have 2 versions of "datanucleus-enhancer" in the CLASSPATH? The DataNucleus Maven plugin v3.0.2 shown here clearly only pulls in v3.0.1 of the enhancer jar. So where is the other one coming from? You have a pom.xml file there somewhere and that will tell you
    -Andy
    DataNucleus - Standardised persistence, multiple datastores

  3. #3
    Join Date
    Jun 2012
    Posts
    5

    Default 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

  4. #4
    Join Date
    Jun 2012
    Posts
    5

    Default

    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?

  5. #5
    Join Date
    Jun 2012
    Posts
    5

    Default

    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

  6. #6

    Default

    The problem is Google's JDO/JPA plugin "datanucleus-appengine" (a plugin for DataNucleus, owned by Google) is being defined as version "2.0.0-final" (specified in that POM file) but this is not in Maven in any (official) place I know of, so where you have that coming from I've no idea. See http://repo1.maven.org/maven2/com/go...eus-appengine/ for what is officially released into Maven (central). This artifact is (incorrectly) bringing in v3.1.x of datanucleus-enhancer (and ASM v4). Find where that comes from and you have the chance to fix it.

    There is an outstanding issue on Google to sort out their publishing of "datanucleus-appengine" in Maven at http://code.google.com/p/datanucleus...er%20Summ ary
    Last edited by andy; Jun 22nd, 2012 at 01:03 AM.
    -Andy
    DataNucleus - Standardised persistence, multiple datastores

  7. #7
    Join Date
    Jul 2012
    Posts
    2

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •