无法读取方案文档 'http://www.springframework.org/schema/context/****.xsd'

本文详细介绍了如何在Maven项目中解决因依赖版本选择不当而导致的错误。通过对比项目中XML配置文件与Maven仓库中对应jar包的版本信息,帮助读者定位并修复版本不匹配的问题。

首先去maven下面找到这个对应的jar包,点击打开如图:
然后把xml文件报错的跟这里面的对比,看看,我是选了一个没有的版本导致的

<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <context:component-scan base-package="com.example.controller" /> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/"/> <property name="suffix" value=".jsp"/> </bean> <mvc:annotation-driven /> </beans> Description Resource Path Location Type GetMapping cannot be resolved to a type LoginController.java /dengluyemian/src/com/example/controller line 9 Java Problem PostMapping cannot be resolved to a type LoginController.java /dengluyemian/src/com/example/controller line 14 Java Problem Referenced file contains errors (http://www.springframework.org/schema/context/spring-context.xsd). For more information, right click on the message in the Problems View and select "Show Details..." springmvc-servlet.xml /dengluyemian/WebContent/WEB-INF line 1 XML Problem Referenced file contains errors (http://www.springframework.org/schema/mvc/spring-mvc.xsd). For more information, right click on the message in the Problems View and select "Show Details..." springmvc-servlet.xml /dengluyemian/WebContent/WEB-INF line 1 XML Problem The import org.springframework.web.bind.annotation.GetMapping cannot be resolved LoginController.java /dengluyemian/src/com/example/controller line 5 Java Problem The import org.springframework.web.bind.annotation.PostMapping cannot be resolved LoginController.java /dengluyemian/src/com/example/controller line 6 Java Problem
最新发布
12-20
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值