`
ynp
  • 浏览: 439474 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

“The string "--" is not permitted ...”的错误,解决方法

阅读更多

————>错误现象:

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⊙)。

分享到:
评论

相关推荐

    nodejs提示:cross-device link not permitted, rename错误的解决方法

    主要给大家介绍了关于nodejs提示:cross-device link not permitted, rename错误的解决方法,文中通过示例代码介绍的非常详细,对大家学习或者使用nodejs具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧

    PHP解决Operation not permitted in

    通过以上方法,我们可以解决PHP中的"Operation not permitted"错误。重要的是要理解Linux的权限模型和用户管理,以便更好地调试和解决这类问题。在生产环境中,安全性和稳定性是首要考虑的因素,因此在调整权限时,...

    MacOS无法挂载NFS Operation not permitted错误解决办法

    总的来说,解决“Operation not permitted”错误的关键在于检查客户端的网络配置、使用`resvport`选项以及在服务器端的NFS导出配置中启用“insecure”连接。希望这个指南能帮助你解决问题,如果还有其他疑问,可以...

    给项目添加依赖:报错operation not permitted, unlink.原来是4048

    阿风在运行 npm i(给项目添加依赖)时遇到了一下报错: npm ERR! code EPERM npm ERR! syscall unlink npm ERR! path D:\Users\Megan\企业微信下载地址\WXWork\... Error: EPERM: operation not permitted, unlink 'D

    GDB调技术教程

    Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation;...

    Linux下普通用户su命令切换控制

    ### Linux下普通用户su命令切换控制 在Linux操作系统中,`su`命令是用于用户身份切换的重要工具之一。...但出于安全考虑,通常需要对普通用户的`su`权限进行一定的控制与限制。 #### su命令概述 ...

    react-native-debugger

    "react-native-debugger"是一款专为React Native开发者设计的强大调试工具,尤其适用于...对于那些仍在使用较旧React Native版本的开发者来说,这是一个非常宝贵的工具,帮助他们提升开发效率,解决可能遇到的问题。

    高中英语语法主谓一致详细讲解PPT课件.pptx

    - No chair and no desk is permitted to be taken out. 3. 特殊结构与单数动词: - “A/This/That + kind/type of + 不可数名词/可数名词复数”结构,谓语动词用单数。例如: - This kind of apples is highly ...

    2019年专业英语四级(语法知识)专项训练及答案.docx

    3. It is not uncommon for there _____ problems of communication between the old and the young. - A. being - B. wopdbe - C. be - D. to be **解析:** 此题考查形式主语结构中的不定式用法。“It is not...

    Windows环境下npm install 报错: operation not permitted, rename的解决方法

    以上方法应该能够解决大多数“operation not permitted, rename”的问题。然而,如果问题仍然存在,可能需要更深入地调查系统环境,例如检查Node.js和npm的日志,或者在开发者社区寻求帮助。记住,每个环境都有其特...

    kafkatool_64bit.exe.zip

    Any non-personal use, including commercial, educational and non-profit work is not permitted without purchasing a license. Non-personal use is allowed for evaluation purposes for 30 days following ...

    SmartHive.AbbEdge-master.zip

    在ABB的解决方案中,边缘计算被用来实时监测和分析机器人运行数据,提前预警潜在故障,避免生产中断。 "SmartHive.AbbEdge"项目可能是ABB公司开发的一个边缘计算框架,专为ABB的机器人系统设计。"master"分支通常...

    sort_20120407.tar.gz

    内排序的方法有许多种,按所采用策略的不同,可归纳为五类:插入排序、选择排序、交换排序、归并排序和分配排序。 其中,插入排序主要包括直接插入排序和希尔排序两种;选择排序主要包括直接选择排序和堆排序;...

    hibernate-shards.jar

    that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a ...

    Keil MDK 编译 ucOS-II 出现的警告和错误解决

    可能会出现错误 L6238E:os_cpu_a.o(subr) contains invalid call from '~PRES8 (The user did not require code to preserve 8-byte aligment of 8-byte data objects)' function to 'REQ8 (Codewas permitted to ...

    GigaDevice.GD32E23x_DFP.1.0.0.pack

    This is a list of ARM Cortex-M based microcontrollers that are supported by Software Packs and can be used in MDK Version 5. For maintaining existing MDK Version 4 projects, or using devices that are...

    EHLib 6.3.171〖D7~XE5〗

    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...

Global site tag (gtag.js) - Google Analytics