-->
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.  [ 1 post ] 
Author Message
 Post subject: Error with mapping file
PostPosted: Fri Aug 19, 2011 9:52 am 
Newbie

Joined: Fri Aug 19, 2011 9:41 am
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.