2010-03-13 6 views
0

Je suis nouveau sur Hibernate. J'ai une exception lors de l'exécution d'une application basée sur Hibernate. L'exception est la suivante:Hibernate - Problème dans le fichier de mappage de l'analyse (.hbm.xml)

16 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.2.GA 
16 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found 
16 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist 
31 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp  handling 
94 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml 
94 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml 
219 [main] INFO org.hibernate.cfg.Configuration - Reading mappings from resource : app/data/City.hbm.xml 
266 [main] ERROR org.hibernate.util.XMLHelper - Error parsing XML: XML InputStream(12) Attribute "coloumn" must be declared for element type "property". 
266 [main] ERROR org.hibernate.util.XMLHelper - Error parsing XML: XML InputStream(13) Attribute "coloumn" must be declared for element type "property". 
266 [main] ERROR org.hibernate.util.XMLHelper - Error parsing XML: XML InputStream(14) Attribute "coloumn" must be declared for element type "property". 

Il semble qu'il ne trouve pas coloumn attribut de l'élément property dans le fichier de mappage, mais mon fichier de mappage ont l'attribut coloumn.

est Ci-dessous le fichier de mappage (City.hbm.xml)

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> 

<hibernate-mapping package="app.data"> 

    <class name="City" table="CITY"> 

    <id column="CITY_ID" name="cityId"> 
     <generator class="native"/> 
    </id> 

    <property name="cityDisplyaName" coloumn="CITY_DISPLAY_NAME" /> 
    <property coloumn="CITY_MEANINGFUL_NAME" name="cityMeaningFulName" /> 
    <property coloumn="CITY_URL" name="cityURL" /> 

    </class> 

</hibernate-mapping> 

Répondre

2

Vous voulez dire column. Il se plaint car coloumn n'est pas un attribut valide de <property>

+0

oh .. quelle erreur stupide j'avais fait ... :) –

2

Vous avez une faute de frappe. Il doit être colonne pas coloumn.

À la votre!

Modifier: trop lent :)