-->
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: cannot read mapping file generated by JBoss Tools
PostPosted: Fri Aug 14, 2009 5:30 pm 
Newbie

Joined: Fri Aug 14, 2009 5:20 pm
Posts: 1
JBoss 4.0.5
Hibernate 3.3.1
MySQL 5.x

I am new to using Hibernate directly. I have been using it via JBoss/EJB3 for a while. I created mapping files using JBoss Tools w/Eclipse. I created a har. When the har is scanned during JBosss statrup it complains:

org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\app\jboss-4.0.5.GA\server\default\deploy\shockwatch.ear\shockwatch.har\com\shockwatch\ejb3\entity\Accelcfg.hbm.xml
at org.hibernate.cfg.Configuration.addFile(Configuration.java:340)
at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:695)
at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:692)
............
............
Caused by: org.xml.sax.SAXParseException: The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

Below is the file it is complaining about. It does appear to have only valid tags per the list it says must be inside "class".
Ideas?

<?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 Aug 13, 2009 3:07:20 PM by Hibernate Tools 3.2.5.Beta -->
<hibernate-mapping>
<class name="com.shockwatch.ejb3.entity.Accelcfg" entity-name="Accelcfg" table="ACCELCFG" proxy="Accelcfg">
<property name="ik" type="int">
<column name="IK" />
</property>
<property name="cfgName" type="java.lang.String">
<column name="CFGNAME" />
</property>
<property name="warnVal" type="java.math.BigDecimal">
<column name="WARNVAL" />
</property>
<property name="alarmVal" type="java.math.BigDecimal">
<column name="ALARMVAL" />
</property>
<property name="useMechSensor" type="java.lang.Boolean">
<column name="USEMECHSENSOR" />
</property>
<property name="useX" type="java.lang.Boolean">
<column name="USEX" />
</property>
<property name="alarmXYAudible" type="java.lang.Boolean">
<column name="ALARMXYAUDIBLE" />
</property>
<property name="alarmXyevent" type="java.lang.Boolean">
<column name="ALARMXYEVENT" />
</property>
<property name="useY" type="java.lang.Boolean">
<column name="USEY" />
</property>
<property name="warnXYAudible" type="java.lang.Boolean">
<column name="WARNXYAUDIBLE" />
</property>
<property name="warnXyevent" type="java.lang.Boolean">
<column name="WARNXYEVENT" />
</property>
<property name="useZ" type="java.lang.Boolean">
<column name="USEZ" />
</property>
<property name="zalarmVal" type="java.math.BigDecimal">
<column name="ZALARMVAL" />
</property>
<property name="zwarnVal" type="java.math.BigDecimal">
<column name="ZWARNVAL" />
</property>
<property name="warnZAudible" type="java.lang.Boolean">
<column name="WARNZAUDIBLE" />
</property>
<property name="alarmZAudible" type="java.lang.Boolean">
<column name="ALARMZAUDIBLE" />
</property>
<property name="alarmZevent" type="java.lang.Boolean">
<column name="ALARMZEVENT" />
</property>
<property name="warnZevent" type="java.lang.Boolean">
<column name="WARNZEVENT" />
</property>
<property name="warnSeconds" type="java.lang.Short">
<column name="WARNSECONDS" />
</property>
<property name="alarmSeconds" type="java.lang.Short">
<column name="ALARMSECONDS" />
</property>
<property name="warnPiezo" type="java.lang.Boolean">
<column name="WARNPIEZO" />
</property>
<property name="alarmPiezo" type="java.lang.Boolean">
<column name="ALARMPIEZO" />
</property>
<set name="unitprofiles" inverse="false" lazy="true" table="UNITPROFILE">
<key></key>
<one-to-many class="com.shockwatch.ejb3.entity.Unitprofile" />
</set>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Re: cannot read mapping file generated by JBoss Tools
PostPosted: Fri Aug 14, 2009 6:15 pm 
Newbie

Joined: Tue Feb 24, 2009 8:39 pm
Posts: 19
It seems that the id field is missing


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.