我正在使用spring 3.0.5并尝试通过context元素读取配置文件:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
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
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
<context:property-placeholder location="classpath:db_config.properties"/>
Run Code Online (Sandbox Code Playgroud)
应用程序启动时,我收到以下错误:
违规资源:ServletContext资源[/WB-INF/spring/applicationContext.xml]; 嵌套异常是org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自ServletContext资源[/WEB-INF/spring/db-config.xml]的XML文档中的第20行无效; 嵌套异常是org.xml.sax.SAXParseException:元素"context:property-placeholder"的前缀"context"未绑定.
我究竟做错了什么?
| 归档时间: |
|
| 查看次数: |
12930 次 |
| 最近记录: |