当前位置 博文首页 > 逐墨飞扬的博客:运行添加spring依赖的项目报错
在配置xml文件时文件头配置为
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
https://www.springframework.org/schema/beans/spring-beans.xsd">
</beans>
注意第五行的开头为【https】,此时在运行项目时,会从网上下载项目运行所要依赖的东西(此时不会从本地寻找所需依赖)。当你的电脑没有网无法联网下载,或是有网,但是没有下载成功时,项目运行就会缺少依赖,理所当然的会报错了。
把配置的xml文件修改为
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
</beans>
注意第五行的开头改为以【http】开头了
cs