Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: Bernard
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Enhancer (ARCHIVED)

Plugin (Bundle) "org.datanucleus" is already registered

Created: 26/Apr/12 05:46 AM   Updated: 18/Jun/12 10:08 AM   Resolved: 26/Apr/12 08:36 AM
Component/s: None
Affects Version/s: 3.0.1
Fix Version/s: None

File Attachments: 1. Zip Archive (7 kB)
2. Zip Archive (8 kB)

java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)

Datastore: PostgreSQL

 Description  « Hide
If I run the test in the attached maven project this requires the enhancer plugin.
If I add a dependency for it then I get the following error:

INFO: DataNucleus Enhancer : Using ClassEnhancer "ASM" for API "JPA"
Exception in thread "main" Plugin (Bundle) "org.datanucleus" is already registered. Ensure you dont have multiple JAR versions of the same plugin in the classpath. The URL "file:/C:/Documents%20and%20Settings/name/.m2/repository/org/datanucleus/datanucleus-core/3.1.0-m2/datanucleus-core-3.1.0-m2.jar" is already registered, and you are trying to register an identical plugin located at URL "file:/C:/Documents%20and%20Settings/name/.m2/repository/org/datanucleus/datanucleus-core/3.0.9/datanucleus-core-3.0.9.jar."

My apologies if I misconfigured anything.
I have searched the web site for a sample JPA Maven project but could not find one.
Maven is very good for writing test cases so I thought this was an easy matter.

Sort Order: Ascending order - Click to sort in descending order
Bernard added a comment - 26/Apr/12 05:47 AM
Failing test case

Bernard added a comment - 26/Apr/12 05:49 AM
EclipseLink test case that runs ok

Andy Jefferson added a comment - 26/Apr/12 08:36 AM - edited
If you get a message about bundle already registered then you have "datanucleus-core" in the classpath more than once, so fix your pom.xml (it is added automatically by the enhancer when that M2 plugin is invoked).

You don't need "datanucleus-core"/"datanucleus-rdbms" for compiling (just for testing), so remove them from the compile step.

An alternative is leave those deps in your pom.xml and then add <exclude> for the DN M2 plugin for "datanucleus-core" and "datanucleus-rdbms", so it takes the deps from your pom. Sadly Maven is such that it is v difficult to have a set up that works for all situations ... compile, test, run, exec plugin

Bernard added a comment - 26/Apr/12 10:15 AM
Thanks very much, and my apologies. It works.