为了账号安全,请及时绑定邮箱和手机立即绑定

出错了,还有大神解答吗

三月 23, 2016 9:17:31 下午 org.hibernate.internal.util.xml.ErrorLogger logErrors

ERROR: HHH000196: Error parsing XML (2) : 必须声明元素类型 "ont-to-many"。

三月 23, 2016 9:17:31 下午 org.hibernate.internal.util.xml.ErrorLogger logErrors

ERROR: HHH000196: Error parsing XML (2) : 元素类型为 "set" 的内容必须匹配 "(meta*,subselect?,cache?,synchronize*,comment?,key,(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,filter*)"。

三月 23, 2016 9:17:31 下午 org.hibernate.internal.util.xml.ErrorLogger logErrors

ERROR: HHH000196: Error parsing XML (2) : 必须声明元素类型 "ont-to-many"。

三月 23, 2016 9:17:31 下午 org.hibernate.internal.util.xml.ErrorLogger logErrors

ERROR: HHH000196: Error parsing XML (2) : 元素类型为 "set" 的内容必须匹配 "(meta*,subselect?,cache?,synchronize*,comment?,key,(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,filter*)"。

Exception in thread "main" java.lang.ExceptionInInitializerError

at Test.add(Test.java:29)

at Test.main(Test.java:16)

Caused by: org.hibernate.InvalidMappingException: Unable to read XML

at org.hibernate.internal.util.xml.MappingReader.legacyReadMappingDocument(MappingReader.java:375)

at org.hibernate.internal.util.xml.MappingReader.readMappingDocument(MappingReader.java:304)

at org.hibernate.cfg.Configuration.add(Configuration.java:518)

at org.hibernate.cfg.Configuration.add(Configuration.java:514)

at org.hibernate.cfg.Configuration.add(Configuration.java:688)

at org.hibernate.cfg.Configuration.addResource(Configuration.java:771)

at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2257)

at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2229)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2209)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2162)

at org.hibernate.cfg.Configuration.configure(Configuration.java:2077)

at org.hibernate.cfg.Configuration.configure(Configuration.java:2056)

at com.imooc.util.HibernateUtil.<clinit>(HibernateUtil.java:18)

... 2 more

Caused by: org.xml.sax.SAXParseException; lineNumber: 24; columnNumber: 51; 必须声明元素类型 "ont-to-many"。

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1906)

at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:763)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:355)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2778)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)

at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)

at org.dom4j.io.SAXReader.read(SAXReader.java:465)

at org.hibernate.internal.util.xml.MappingReader.legacyReadMappingDocument(MappingReader.java:325)

... 14 more


正在回答

2 回答

跟楼主错误一样。。请问如何解决的谢谢!!!

0 回复 有任何疑惑可以回复我~

找到错了

0 回复 有任何疑惑可以回复我~
#1

无戏

可以问下哪里错了吗
2016-03-31 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Hibernate初探之一对多映射
  • 参与学习       42171    人
  • 解答问题       295    个

Hibernate中一对多关联映射配置,以及cascade和inverse属性作用

进入课程

出错了,还有大神解答吗

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信