Joined: Fri Mar 26, 2004 7:02 am Posts: 17
|
Hi,
I'm using 2.1.2
I've one global configuration file:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="use_outer_join">true</property>
<property name="max_fetch_depth">2</property>
<property name="show_sql">true</property>
<!-- Mapping files -->
<mapping resource="ph/news/model/News.hbm.xml"/>
<mapping resource="ph/news/model/Links.hbm.xml"/>
<mapping resource="ph/news/model/BacinoLinguistico.hbm.xml"/>
<mapping resource="ph/news/model/NewsImage.hbm.xml"/>
<mapping resource="ph/news/model/PicturedNews.hbm.xml"/>
</session-factory>
</hibernate-configuration>
-----
And a mapping file that has the problem:
----
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="ph.news.model.NewsImage" table="ph_news_images" discriminator-value="main">
<id name="id" type="int" column="f_id" unsaved-value="0">
<generator class="identity"/>
</id>
<discriminator column="tipo" type="string"/>
<property name="path"/>
<property name="mimetype"/>
<property name="nome" column="foto_nome"/>
<subclass name="ph.news.model.RelatedImage" discriminator-value="related">
<property name="priorita"/>
</subclass>
</class>
</hibernate-mapping>
I've the follwing problem:
net.sf.hibernate.MappingException: Error reading resource: ph/news/model/NewsImage.hbm.xml
.
.
.
Caused by: net.sf.hibernate.MappingException: duplicate import:
NewsImage
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:1229)
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:315)
... 53 more
---------
Why??
I readed previous posts but regarding "Duplicate import " but I didn't found my answer
|
|