I have an app that has been running without a 2nd level cache for a couple years... so I am pretty familiar with the Hibernate technology. I am going through the steps of upgrading from 3.0.5 to 3.2.4, and at the same time I am introducing some cacheing. I have everything working with 3.2.4, but when I add:
Code:
<cache usage="read-only"/>
to my hibernate-mapping file I get the following error. I have checked the DTD included in the JAR as well as the DTD online and both seem to look like this should work.
Code:
2007-05-14 19:19:52,816 ERROR [main] (XMLHelper.java:61) - Error parsing XML: XML InputStream(30) 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-on
e|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)*)".
2007-05-14 19:19:52,910 ERROR [main] (HibernateUtil.java:42) - org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/connectfirst/intelliqueue/model/Account.hbm.xml
org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/connectfirst/intelliqueue/model/Account.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 org.hibernate.cfg.Configuration.configure(Configuration.java:1414)
at com.connectfirst.intelliqueue.utils.HibernateUtil.<clinit>(HibernateUtil.java:36)
at com.connectfirst.intelliqueue.IntelliQueue.startup(IntelliQueue.java:97)
at com.connectfirst.intelliqueue.IntelliQueue.main(IntelliQueue.java:55)
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)
... 9 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|lis
t|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.dom4j.io.SAXReader.read(SAXReader.java:334)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:499)
... 10 more
Here is my complete hibernate-mapping 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">
<hibernate-mapping>
<class name="com.connectfirst.intelliqueue.model.Account" table="tbl_acd_accounts">
<id name="accountID" type="string" column="account_ID"/>
<property name="accountName" column="account_name" length="100" not-null="true"/>
<property name="offHookHold" column="off_hook_hold"/>
<property name="offHookWhisper" column="off_hook_whisper"/>
<property name="offHookWhisperGhost" column="off_hook_whisper_ghost"/>
<property name="outboundPrepay" column="outbound_prepay"/>
<property name="defaultOutdialServerGroupId" column="default_outdial_server_group_id"/>
<property name="overrideDispositions" column="override_dispositions"/>
<set name="gateGroups" inverse="true" cascade="all,delete-orphan">
<key column="account_id"/>
<one-to-many class="com.connectfirst.intelliqueue.model.GateGroup"/>
</set>
<set name="agents" table="tbl_acd_accounts_agents" lazy="true">
<key column="account_id"/>
<many-to-many class="com.connectfirst.intelliqueue.model.Agent" column="agent_id"/>
</set>
<cache usage="read-only" />
</class>
</hibernate-mapping>
Thanks in advance!
Geoff