SSM框架的搭建-xml文件报错-.xsd文件缺失

按老师给的教程搭建,其中spring-common.xml(文件名无所谓,只是一个配置文件)一直报错。

<!-- 5. 使用声明式事务
         transaction-manager:引用上面定义的事务管理器
     -->
    <tx:annotation-driven transaction-manager="txManager" />

这段话,eclipse提示我

Multiple annotations found at this line: - cvc-complex-type.2.4.c: 

The matching wildcard is strict, but no declaration can be found for element 'tx:annotation-driven'. 


大概意思就是找不到‘’单引号里面标签(Multiple 。。。element都是这类错误的套话)。

后面提示我,是一个网址找不到:
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
尝试重启eclipse,刷新项目,打开之后可以看到下面“process” 里这个网址已经加载出来了,但就是报错

百度一下,就是.xsd文件缺失,可能网不好,那个文件一直没和elipse联系上,编译器不认。

找到解决博客:https://blog.csdn.net/lililidahaoren/article/details/80394591

不同之处:第一步下载,直接把上面xsd文件网址在浏览器搜索一下,下载到本机,就可以了,
其余步骤同上述博客相同,最后右键project,“validate”(或许译为“验证”)

可以了。果然没有问题解决不了,只是过程有长有短,耐心有多有少。





 


原文地址:https://www.cnblogs.com/mo-sheng/p/14017715.html