加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Content is not allowed in trailing section.

发布时间:2020-12-15 23:26:54 所属栏目:百科 来源:网络整理
导读:今天启动项目时遇到一个错误,找了半天才找到,现在总结下遇到这个问题如何解决.错误如下: Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream at org.hibernate.cfg.Configuration.addInputStream(C

 今天启动项目时遇到一个错误,找了半天才找到,现在总结下遇到这个问题如何解决.错误如下:

Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:555)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:677)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1400)
... 46 more
Caused by: org.dom4j.DocumentException: Error on line 26 of document : Content is not allowed in trailing section. Nested exception: Content is not allowed in trailing section.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:546)
... 50 more
2013-9-10 9:36:31 org.apache.catalina.core.StandardContext start
严重: Error listenerStart

原因如下:

 

1.xml内容不正确,原来是我在后面多加了个s,

2.如果结束时有空格也会出现类似问题.

希望今后不会再犯类似的错,写 xml时要细心点.希望能对大家有帮助.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读