The content of element type "bean" must match "(description?,(constructor-arg|property|lookup-method|replaced-method)*)".

开发中,总有一下奇奇怪怪的问题

完整的错误就不贴了,异常提示:

hibernate.xml] is invalid; nested exception is org.xml.sax.SAXParseException: 
The content of element type "bean" must match "(description?,(constructor-arg|property|lookup-method|replaced-method)*)". org.xml.sax.SAXParseException:
The content of element type "bean" must match "(description?,(constructor-arg|property|lookup-method|replaced-method)*)".

简单来说,就是你的配置文件中有问题,具体什么问题,得直接一个一个排除。

可能性排除:

1、标签没有闭合

##检查标签,最好按照格式把标签都规范好。

2、账号或者秘钥错误

##确认连接数据库的账号、密码、库、ip、驱动都正确(总一下你想象不到的情况)

3、数据源ID配置没有对应上(可能比较大)

##确认你的dataSource和sessionFactory配置的对应上

4、标签写法不规范(可能性为0.1)

<ref local="sessionFactory"/> 都换成 <ref bean="sessionFactory"/>

spring-4.*不支持local了。

 

posted @ 2018-04-25 11:21  learcher  阅读(403)  评论(0编辑  收藏  举报