-
Hibernate mapping help (3 messages)
- Posted by: Time PassX
- Posted on: February 14 2010 05:24 EST
Hi, I am learning hibernate and getting following exception. Kindly have a look at my code, stack trace and suggest solution. mapping: Mobile.hbm.xml <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> Complete Stack Trace: org.hibernate.MappingException: Could not read mappings from resource: Mobile.hbm.xml at org.hibernate.cfg.Configuration.addResource(Configuration.java:485) at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465) at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390) at org.hibernate.cfg.Configuration.configure(Configuration.java:1310) at org.hibernate.cfg.Configuration.configure(Configuration.java:1296) at com.mindtree.dao.MobileDAOImpl.addInvoice(MobileDAOImpl.java:25) at com.mindtree.dao.Test.main(Test.java:18) Caused by: org.hibernate.MappingException: invalid mapping at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:425) at org.hibernate.cfg.Configuration.addResource(Configuration.java:482) ... 8 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.dom4j.io.SAXReader.read(SAXReader.java:465) at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:422) ... 9 more ThanksThreaded Messages (3)
- Re: Hibernate mapping help by D D on February 14 2010 13:47 EST
- help by matt coleman on October 15 2012 01:42 EDT
- hi by club stork on October 16 2012 03:31 EDT
-
Re: Hibernate mapping help[ Go to top ]
- Posted by: D D
- Posted on: February 14 2010 13:47 EST
- in response to Time PassX
Hello, At the very first glance, I see the hbm file is NOT adhering to the DTD. Try changing the hbm like following. Thanks & Regards Diwakar -
help[ Go to top ]
- Posted by: matt coleman
- Posted on: October 15 2012 01:42 EDT
- in response to Time PassX
this tutorial is very helpful for the hibernating issues
-
hi[ Go to top ]
- Posted by: club stork
- Posted on: October 16 2012 03:31 EDT
- in response to Time PassX
you pointed the problem clearly