I'm using Hibernate 3.6.7.Final under Tomcat 5.5, and got a strange error message on start:
Code:
INFO org.hibernate.cfg.Configuration - Reading mappings from resource : [...]/Prepay.hbm.xml
ERROR org.hibernate.util.xml.ErrorLogger - Error parsing XML (5) : Element type "hibernate-mapping" must be declared.
org.hibernate.util.xml.ErrorLogger - Error parsing XML (2) : Attribute "default-cascade" must be declared for element type "hibernate-mapping".
[...]
Initial SessionFactory creation failed.org.hibernate.InvalidMappingException: Unable to read XML
The hbm file:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 2011.08.19. 15:34:46 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="[...].Prepay" table="prepay" catalog="docomp">
<id name="id" type="java.lang.Long">
<column name="id" />
<generator class="identity" />
</id>
<many-to-one name="account" class="[...].Account" fetch="select">
<column name="account_id" not-null="true" />
</many-to-one>
<property name="recipientData" type="string">
<column name="recipient_data" length="65535" not-null="true" />
</property>
</class>
</hibernate-mapping>
The hbm file is reverse generated from the database using Ecplise. The file is readable, if I null it, i got different error msg. I know the dtd is old, but doesn't help if i change it to the new one. What could be the problem?
The strange part, that it works on my developer machine, but not on the webserver. Dev machine uses jetty.