————>错误现象:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.ExceptionInInitializerError
at test.HibernateTest.saveDE(HibernateTest.java:30)
at test.HibernateTest.main(HibernateTest.java:18)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/xx/domain/Depart.hbm.xml
...........
Caused by: org.dom4j.DocumentException: Error on line 15 of document : The string "--" is not permitted within comments. Nested exception: The string "--" is not permitted within comments.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
...........
-------------->原因及解决方法
原因是我在Hibernate的hbm.xml中加入了如下注释:
<!----------- depart通过depart_id查找到employee ------------->
<!-------------
<set name="ems">
<key column="depart_id"/>
<one-to-many class="Employee" />
</set>
----------------->
加了几个“---”看着是显眼(jsp中经常这么干),就报了这么个错,把多余的横线删除就ok了!网上说和解释中的字数个数有关,好像不是吧(⊙o⊙)。
分享到:
相关推荐
LookupDisplayFieldName: String - Identifies the field from the lookup dataset whose value is displayed in place of KeyFields. LookupKeyFieldNames: String - Identifies the field or fields in the lookup...
-- List of regexpressions describing the interface (if any) that represent tetherable Wifi interfaces. If the device doesn't want to support tethering over Wifi this should be empty. An example ...
-- List of regexpressions describing the interface (if any) that represent tetherable Wifi interfaces. If the device doesn't want to support tethering over Wifi this should be empty. An example ...
The No One Lives Forever (NOLF) Source Code v1.003 is not officially supported by Monolith Productions, Inc. or Fox Interactive. If you plan to modify the NOLF Source Code it is assumed that you have ...
* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND...
if (subject.isPermitted("some:permission")) { // 用户有权限 } else { // 用户没有权限 } ``` ### Java 并发编程(JUC) #### 概述 Java 并发编程主要依赖于 Java Util Concurrency (JUC) 包中的类和接口。...
如果验证成功,我们就可以使用 Shiro 的 `isPermitted` 方法来验证用户是否拥有某个权限。 本文详细介绍了如何将 SpringBoot 整合 Shiro,以实现用户登录和权限验证。通过使用 Shiro,我们可以轻松地实现权限认证和...