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了。

相關文章
相關標籤/搜索