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
|