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

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

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

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)*)".

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

可能性排除:session

一、标签没有闭合hibernate

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

二、帐号或者秘钥错误blog

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

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

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

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

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

spring-4.*不支持local了。

相关文章
相关标签/搜索