-->
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.  [ 2 posts ] 
Author Message
 Post subject: Duplicate import and Ant 1.6.1
PostPosted: Wed May 19, 2004 4:34 pm 
Newbie

Joined: Wed May 19, 2004 1:43 pm
Posts: 1
Hi!

I wrote an Ant task to execute some hibernate based work. The Ant task works pretty well when using Ant v. 1.5.4, but fails miserably when using Ant 1.6.1. Switched back to 1.5.4 and the problem vanished, the exception being net.sf.hibernate.MappingException: duplicate import: Cliente

Any ideas? When I get the source of the problem, I'll post it.


Cheers


Javier




ERROR: [Configuration][add] Could not compile the mapping document
net.sf.hibernate.MappingException: duplicate import: Cliente
at net.sf.hibernate.cfg.Mappings.addImport(Mappings.java:85)
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:126)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:333)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:874)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:860)
at lucidees.common.eai.InsertorDatos.init(InsertorDatos.java:62)
at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:402)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:152)
at org.apache.tools.ant.Task.perform(Task.java:363)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at org.apache.tools.ant.Main.runBuild(Main.java:632)
at org.apache.tools.ant.Main.startAnt(Main.java:183)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
net.sf.hibernate.MappingException: Error reading resource: com/satmex/sigue/Cliente.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:874)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:860)
at lucidees.common.eai.InsertorDatos.init(InsertorDatos.java:62)
at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:402)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:152)
at org.apache.tools.ant.Task.perform(Task.java:363)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at org.apache.tools.ant.Main.runBuild(Main.java:632)
at org.apache.tools.ant.Main.startAnt(Main.java:183)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
Caused by: net.sf.hibernate.MappingException: duplicate import: Cliente
at net.sf.hibernate.cfg.Mappings.addImport(Mappings.java:85)
at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:126)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:221)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:285)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:333)
... 16 more

Mapping file:

<hibernate-configuration>

<session-factory>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="query.imports">net.sf.hibernate.test, net.sf.hibernate.eg</property>
<property name="show_sql">false</property>

<property name="dialect">net.sf.hibernate.dialect.InterbaseDialect</property>
<property name="connection.driver_class">org.firebirdsql.jdbc.FBDriver</property>
<property name="connection.url">jdbc:firebirdsql:localhost/3050:c:/sigue/sigue.gdb</property>
<property name="connection.username">SYSDBA</property>
<property name="connection.password">masterkey</property>

<!-- Archivos de mapeo -->
<mapping resource="com/satmex/sigue/Cliente.hbm.xml"/>
<mapping resource="com/satmex/sigue/Usuario.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Antena.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Banda.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Entidad.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/EstacionTerrena.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/HPA.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Localidad.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Modem.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Modulacion.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Pais.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Polarizacion.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Portadora.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Region.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Satelite.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/TecnicaAcceso.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/TipoServicio.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/Transpondedor.hbm.xml"/>
<mapping resource="com/satmex/sigue/espacio/ValorAtenuacion.hbm.xml"/>
<mapping resource="com/satmex/sigue/ic/Enlace.hbm.xml"/>
<mapping resource="com/satmex/sigue/ic/PlanTransmision.hbm.xml"/>
<mapping resource="com/satmex/sigue/ic/Solicitud.hbm.xml"/>
<mapping resource="com/satmex/sigue/ic/Status.hbm.xml"/>
<mapping resource="com/satmex/sigue/ic/TopologiaRed.hbm.xml"/>
</session-factory>

</hibernate-configuration>

Hibernate versions: 2.0.1, 2.1.3


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 20, 2004 3:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ant 1.6 has changed some of their classloading semantics ... check for that ;)

_________________
Max
Don't forget to rate


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

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.