These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: .DuplicateMappingException: Duplicate collection role mappin
PostPosted: Mon Nov 20, 2006 9:50 am 
Beginner
Beginner

Joined: Mon Nov 20, 2006 9:06 am
Posts: 29
Hi, i cannot find information about this problem.

I try to generate schema-export with maven-hibernate3 plugin.

I get this exception every time.

I use command:
$ mvn clean compile resources:resources hibernate3:schema-export

The error always occurs at the first hbm.xml it tries to map, so I can shortcut the logging to the relevant parts.


..........
........
[INFO] [clean:clean]
[INFO] Deleting directory r:\Projects\Vivici\Build\home\verhees\Zorggemak\ACode\sandbox\openehr-orm\target
[INFO] Deleting directory r:\Projects\Vivici\Build\home\verhees\Zorggemak\ACode\sandbox\openehr-orm\target\classes
[INFO] Deleting directory......... cleaning
........
........
........
Compiling 45 source files to r:\Projects\Vivici\Build\home\verhees\Zorggemak\ACode\sandbox\openehr-orm\target\classes
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [hibernate3:schema-export]
[INFO] using java version jdk15
INFO [main] (Version.java:15) - Hibernate Annotations 3.2.0.CR1
INFO [main] (Environment.java:499) - Hibernate 3.2 cr2
INFO [main] (Environment.java:532) - hibernate.properties not found
INFO [main] (Environment.java:666) - Bytecode provider name : cglib
INFO [main] (Environment.java:583) - using JDK 1.4 java.sql.Timestamp handling
INFO [main] (Configuration.java:1379) - configuring from file: hibernate.cfg.xml
DEBUG [main] (DTDEntityResolver.java:22) - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
DEBUG [main] (DTDEntityResolver.java:24) - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
DEBUG [main] (DTDEntityResolver.java:34) - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
DEBUG [main] (Configuration.java:1306) - connection.driver_class=com.mysql.jdbc.Driver
DEBUG [main] (Configuration.java:1306) - connection.url=jdbc:mysql://10.1.1.172:3306/zorggemak
DEBUG [main] (Configuration.java:1306) - connection.username=javauser
DEBUG [main] (Configuration.java:1306) - connection.password=javadude
DEBUG [main] (Configuration.java:1306) - connection.pool_size=1
DEBUG [main] (Configuration.java:1306) - dialect=org.hibernate.dialect.MySQLDialect
DEBUG [main] (Configuration.java:1306) - show_sql=true
............
............
DEBUG [main] (AnnotationConfiguration.java:424) - null<-org.dom4j.tree.DefaultAttribute@1dafbaf [Attribute: name resource value "Archetyped.hbm.xml"]
INFO [main] (Configuration.java:502) - Reading mappings from resource: Archetyped.hbm.xml
DEBUG [main] (DTDEntityResolver.java:22) - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
DEBUG [main] (DTDEntityResolver.java:24) - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
DEBUG [main] (DTDEntityResolver.java:34) - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
DEBUG [main] (AnnotationConfiguration.java:424) - null<-org.dom4j.tree.DefaultAttribute@18adae2 [Attribute: name resource value "AuditDetails.hbm.xml"]
INFO [main] (Configuration.java:502) - Reading mappings from resource: AuditDetails.hbm.xml
DEBUG [main] (DTDEntityResolver.java:22) - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
DEBUG [main] (DTDEntityResolver.java:24) - recognized hibernate namespace; attempting to resolve on classpath under org/hiberna
(about 30 hbm.xml files in same directory)
............
............
............
............
DEBUG [main] (AnnotationConfiguration.java:232) - Execute first pass mapping processing
DEBUG [main] (AnnotationConfiguration.java:336) - Process hbm files
INFO [main] (HbmBinder.java:298) - Mapping class: org.openehr.rm.common.archetyped.Archetyped -> archetyped
DEBUG [main] (HbmBinder.java:1252) - Mapped property: referenceModelVersion -> reference_model_version
DEBUG [main] (HbmBinder.java:1252) - Mapped property: archetypeID -> archetype_id
INFO [main] (HbmBinder.java:298) - Mapping class: org.openehr.rm.common.generic.AuditDetails -> audit_details
DEBUG [main] (HbmBinder.java:1252) - Mapped property: systemId -> system_id
DEBUG [main] (HbmBinder.java:1252) - Mapped property: committer -> committer_id
DEBUG [main] (HbmBinder.java:1252) - Mapped property: timeCommitted -> time_committed_id
DEBUG [main] (HbmBinder.java:1252) - Mapped property: changeType -> change_type_id
DEBUG [main] (HbmBinder.java:1252) - Mapped property: description -> description_id
INFO [main] (HbmBinder.java:815) - Mapping subclass: org.openehr.rm.common.generic.Attestation -> audit_details
DEBUG [main] (HbmBinder.java:1252) - Mapped property: attestedView -> attested_view_id
DEBUG [main] (HbmBinder.java:1252) - Mapped property: isPending -> is_pending
DEBUG [main] (HbmBinder.java:1252) - Mapped property: items
......
......
......
mapping all classes, also this one.....
INFO [main] (HbmBinder.java:298) - Mapping class: org.openehr.rm.common.archetyped.FeederAudit -> feeder_audit
DEBUG [main] (HbmBinder.java:1252) - Mapped property: feederSystemAudit -> feeder_audit_details_id
DEBUG [main] (HbmBinder.java:1252) - Mapped property: feederSystemItemIDs
DEBUG [main] (HbmBinder.java:1252) - Mapped property: originatingSystemAudit -> originating_system_audit_id
DEBUG [main] (HbmBinder.java:1252) - Mapped property: originatingSystemItemIDs
......
......
......
and more classes
......
......
......
......
and in the end, this happens
......
......
......
......
INFO [main] (Mappings.java:138) - duplicate import: org.openehr.rm.common.archetyped.FeederAudit->org.openehr.rm.common.archetyped.FeederAudit
INFO [main] (Mappings.java:138) - duplicate import: org.openehr.rm.common.archetyped.FeederAudit->FeederAudit
INFO [main] (HbmBinder.java:298) - Mapping class: org.openehr.rm.common.archetyped.FeederAudit -> feeder_audit
DEBUG [main] (HbmBinder.java:1252) - Mapped property: feederSystemAudit -> feeder_audit_details_id
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Duplicate collection role mapping org.openehr.rm.common.archetyped.FeederAudit.feederSystemItemIDs
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.hibernate.DuplicateMappingException: Duplicate collection role mapping org.openehr.rm.common.archetyped.FeederAudit.feederSystemItemIDs
at org.hibernate.cfg.Mappings.addCollection(Mappings.java:124)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2027)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:2002)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:357)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:271)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:142)
at org.hibernate.cfg.Configuration.add(Configuration.java:419)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:338)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:265)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034)
at org.codehaus.mojo.hibernate3.HibernateExporterMojo.getConfiguration(HibernateExporterMojo.java:110)
at org.codehaus.mojo.hibernate3.exporter.SchemaExportMojo.doSchemaExport(SchemaExportMojo.java:63)
at org.codehaus.mojo.hibernate3.exporter.SchemaExportMojo.doExecute(SchemaExportMojo.java:51)
at org.codehaus.mojo.hibernate3.HibernateExporterMojo.execute(HibernateExporterMojo.java:60)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:488)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
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)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45 seconds
[INFO] Finished at: Mon Nov 20 14:39:28 CET 2006
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------

There is no duplicate import, the error happens at this hbm-file, but as I remove it, the error occurs at another hbm-file.

If I remove the offending collection-properties, the error exception at classlevel dupication comes up.

For information, my hibernate.cfg.xml (partly)

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://10.1.1.172:3306/zorggemak</property>
<property name="connection.username">javauser</property>
<property name="connection.password">javadude</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

<!-- Mapping files -->
<mapping resource="Archetyped.hbm.xml"/>
<mapping resource="AuditDetails.hbm.xml"/>
<mapping resource="AuthoredResource.hbm.xml"/>
<mapping resource="Contribution.hbm.xml"/>
<mapping resource="DataValue.hbm.xml"/>
<mapping resource="EHR.hbm.xml"/>
<mapping resource="EventContext.hbm.xml"/>
<mapping resource="FeederAudit.hbm.xml"/>
(there are more mapping files, but this is the one that gives the error, at this moment)
</session-factory>
</hibernate-configuration>

Thanks in advance for helping, I am struggling three days with this now, loosing really time I do not have


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.