1

I always get this error message when i call my servlet...

failed:org.hibernate.InvalidMappingException: Could not parse mapping document from resource CarDetail.hbm.xml

CarDetail.hbm.xml:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="at.opendata.entitys">      
    <class name="CarDetail" table="cardetail">
        <id name="id" column="detail_id">
            <generator class="increment"/>
        </id>
        <property name="gone" type="time"/>
        <property name="back" type="time"/>
        <property name="currentdatetime" type="timestamp"/>
        <property name="coordinates" type="org.hibernate.spatial.GeometryType" column="coordinates"/>
        <many-to-one name="car" column="car_id" class="Car" not-null="true"/>       
    </class>
</hibernate-mapping>

Why do i get this error message? Another mapping file is found in the same directory..

krackmoe
  • 1,743
  • 7
  • 29
  • 53
  • because you have invalid document – Roman C Jan 29 '13 at 21:11
  • didn't put a type of id attribute – Roman C Jan 29 '13 at 21:41
  • 1
    i miss an id? and where? – krackmoe Jan 29 '13 at 21:49
  • @krackmoe You don't miss an id. You miss the **type** of the id. Instead of `` you need to specify ``. Apparently, [the very nice tutorial on joss.org](http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/tutorial.html#tutorial-firstapp-setup) is buggy (like most tutorials on the web...) – Withheld Sep 27 '13 at 18:53
  • Another example of a "tutorial bug" is that the [mapping file](http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/tutorial.html#tutorial-firstapp-mapping) specifies a ` – Withheld Sep 27 '13 at 19:25

0 Answers0