2014/01/09

[spring] The prefix "context" for element "context:property-placeholder"...

在 ApplicationContext 載入 xml 時,丟出 org.xml.sax.SAXParseException
詳細的 exception 說明如下
The prefix "context" for element "context:property-placeholder" is not found
原因為 namespace 沒有定義,所以 parser 不認識 context,必須在 beans 的部分新增 context 的相關設定。
<beans xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://www.springframework.org/schema/beans" 
    xsi:schemalocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-3.0.xsd">
</beans>

沒有留言:

張貼留言