问题1
配置
报错:The prefix “context” for element “context:component-scan” is not bound.
解决方法:
beans中加上
xmlns:context= “http://www.springframework.org/schema/context”
beans中的xsi:schemaLocation加上两行
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd”
问题2
上步由于疏忽加成
http://www.springframework.org/schema/beans/spring-context.xsd”
报错:Multiple annotations found at this line:
- schema_reference.4: Failed to read schema document ‘http://www.springframework.org/schema/beans/spring-context.xsd’
解决方法:改成即可
其实这些加的命名空间都是可以访问的,复制粘贴到浏览器上访问一下,这种问题首先要用这种方法排除URL拼写错误.