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: error in hibernate mapping file ?
PostPosted: Fri May 12, 2006 1:52 pm 
Newbie

Joined: Fri May 12, 2006 1:46 pm
Posts: 1
salut tout le monde :
voila mon Client.hbm

<?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="com.mines.hibernate.Client" table="client">
<id name="IdClient" type="string">
<column name="ID_Client" sql_type="char(30)" />
<generator class="increment" />
</id>

<property name="ListeSecteur" type="string" >
<column name="Liste_secteur" sql_type="char(30)" not-null="false" />
</property>

<property name="Mail" type="string">
<column name="Mail" sql_type="char(80)" not-null="false" />
</property>

<property name="Addresse" type="string" >
<column name="Addresse" sql_type="char(120)" not-null="false" />
</property>


<property name="Tel" type="string">
<column name="Tel" sql_type="char(14)" not-null="false" />
</property>


<property name="Login" type="string">
<column name="Login" sql_type="char(30)" not-null="false" />
</property>


</class>

</hibernate-mapping>

et quand j'exécute mon programme sous eclipse 2 , hiberbnate é, bd mysql il donne :

11 mai 2006 15:25:27 net.sf.hibernate.cfg.Environment <clinit>
INFO: Hibernate 2.1.6
11 mai 2006 15:25:27 net.sf.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
11 mai 2006 15:25:27 net.sf.hibernate.cfg.Environment <clinit>
INFO: using CGLIB reflection optimizer
11 mai 2006 15:25:27 net.sf.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
11 mai 2006 15:25:27 net.sf.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
11 mai 2006 15:25:27 net.sf.hibernate.cfg.Configuration addResource
INFO: Mapping resource: Client.hbm
11 mai 2006 15:25:27 net.sf.hibernate.util.XMLHelper$ErrorLogger error
GRAVE: Error parsing XML: XML InputStream(8) Lattribut "{0}" nest pas déclaré pour lélément "{1}".
11 mai 2006 15:25:27 net.sf.hibernate.util.XMLHelper$ErrorLogger error
GRAVE: Error parsing XML: XML InputStream(13) Lattribut "{0}" nest pas déclaré pour lélément "{1}".
11 mai 2006 15:25:27 net.sf.hibernate.util.XMLHelper$ErrorLogger error
GRAVE: Error parsing XML: XML InputStream(17) Lattribut "{0}" nest pas déclaré pour lélément "{1}".
11 mai 2006 15:25:27 net.sf.hibernate.util.XMLHelper$ErrorLogger error
GRAVE: Error parsing XML: XML InputStream(21) Lattribut "{0}" nest pas déclaré pour lélément "{1}".
11 mai 2006 15:25:27 net.sf.hibernate.util.XMLHelper$ErrorLogger error
GRAVE: Error parsing XML: XML InputStream(26) Lattribut "{0}" nest pas déclaré pour lélément "{1}".
11 mai 2006 15:25:27 net.sf.hibernate.util.XMLHelper$ErrorLogger error
GRAVE: Error parsing XML: XML InputStream(31) Lattribut "{0}" nest pas déclaré pour lélément "{1}".
java.lang.ExceptionInInitializerError
at Test.main(Test.java:8)
Caused by: java.lang.RuntimeException: Problème de configuration : Error reading resource: Client.hbm
at com.mines.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:12)
... 1 more
Caused by: net.sf.hibernate.MappingException: Error reading resource: Client.hbm
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:339)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:1013)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:969)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:897)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
at com.mines.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:10)
... 1 more
Caused by: net.sf.hibernate.MappingException: invalid mapping
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:287)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
... 6 more
Caused by: org.xml.sax.SAXParseException: Lattribut "{0}" nest pas déclaré pour lélément "{1}".
at org.apache.crimson.parser.Parser2.error(Unknown Source)
at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
at org.apache.crimson.parser.Parser2.content(Unknown Source)
at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
at org.apache.crimson.parser.Parser2.content(Unknown Source)
at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
at org.apache.crimson.parser.Parser2.content(Unknown Source)
at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
at org.apache.crimson.parser.Parser2.parse(Unknown Source)
at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:286)
... 7 more
Exception in thread "main"


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 17, 2006 4:52 pm 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
sql-type (avec un tirait) et non sql_type (avec un underscore)

(check the dtd :)


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.