Thought the same thing. Two different XML editors in Eclipse give the same error (below). Could my reference to the DTD be wrong? Is the editor using the one from the Web instead of the local jar? If I'm on Hibernate 3.2.x, why hasn't the DTD been updated since 3.0? Surely
something's changed in it since 3.0?
Editor Error
Code:
Severity and Description Path Resource Location Creation Time Id
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)*)". FinancialCrimesInquiry/src/us/tx/state/oag/FinancialCrimesInquiry/db/userSelects HbmUserSelectStatements.hbm.xml line 8 1178283600265 86332
And JBoss doesn't like it either:Code:
08:05:13,937 ERROR [XMLHelper] Error parsing XML: XML InputStream(31) 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)*)".
08:05:13,937 ERROR [[/FinancialCrimesInquiry]] Exception sending context initialized event to listener instance of class us.tx.state.oag.FinancialCrimesInquiry.ContextListener
org.hibernate.InvalidMappingException: Could not parse mapping document from resource us/tx/state/oag/FinancialCrimesInquiry/db/userSelects/HbmUserSelectStatements.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:569)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1587)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1555)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1534)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1508)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1428)
at us.tx.state.oag.FinancialCrimesInquiry.ContextListener.contextInitialized(ContextListener.java:52)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
...
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:502)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:566)
... 143 more
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)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:499)
... 144 more
Updated hbm.xml fileCode:
<?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 default-cascade="none" default-access="property" auto-import="true"
package="us.tx.state.oag.FinancialCrimesInquiry.db.userSelects">
<class name="HbmUserSelectStatements" table="info_user_select_statements">
<id name="SelectId" column="select_id" type="long">
<generator class="identity"/>
</id>
<property name="UserId" column="user_id" type="string" length="12" not-null="true" update="true" insert="true"/>
<property name="Name" column="select_name" type="string" length="60" not-null="true" update="true" insert="true"/>
<property name="DateCreated" column="date_created" type="timestamp" length="23" not-null="true" update="true" insert="true"/>
<property name="Description" column="description" type="string" update="true" insert="true"/>
<property name="IsDisabled" column="is_disabled" type="int" update="true" insert="true"/>
<property name="IsPublic" column="is_public" type="int" update="true" insert="true"/>
<list name="SelectFields" inverse="true" lazy="false" cascade="all">
<key column="select_id" not-null="true"/>
<index column="select_field_id"/>
<one-to-many class="HbmUserSelectFields"/>
</list>
<sql-insert callable="true">{ ? = call info_user_select_statements_spa (?,?,?,?,?,?,?) }</sql-insert>
<sql-delete callable="true">{ ? = call info_user_select_statements_spd (?) }</sql-delete>
<sql-update callable="true">{ ? = call info_user_select_statements_spu (?,?,?,?,?,?,?) }</sql-update>
</class>
<sql-query name="info_user_selects_list_spr" callable="true">
<return alias="hbmUserSelectStatements" class="HbmUserSelectStatements"/>
<![CDATA[
{ call info_user_selects_list_spr(?) }
]]>
</sql-query>
<sql-query name="info_user_select_statements_spr" callable="true">
<return alias="hbmUserSelectStatements" class="HbmUserSelectStatements"/>
<![CDATA[
{ call info_user_select_statements_spr(?) }
]]>
</sql-query>
</hibernate-mapping>