-->
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.  [ 3 posts ] 
Author Message
 Post subject: Duplicate import error why?
PostPosted: Fri Mar 26, 2004 7:08 am 
Newbie

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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 26, 2004 7:13 am 
Newbie

Joined: Fri Mar 26, 2004 7:02 am
Posts: 17
If i comment subclass definition I've no errore and It works fine.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 26, 2004 8:09 am 
Newbie

Joined: Fri Mar 26, 2004 7:02 am
Posts: 17
Solved!!!!

There was an error on subclass' property "priorita" : in the java class it was "piotpita" (jut a typing error).....but... why Hibernate tell me that it was a "duplicate import" error?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.