配置spring.web.xml/spring-service.xml/spring-dao.xml报错

来源:2-6 逐层完成SSM的各项配置

KaWhi_Lin

2018-03-13

你好,我用的是myeclipse,在配置ssm的时候按照教程流程走的,spring.xml的各个部分都出现了类似下面的问题,是因为本地找不到jar包吗?应该怎么解决呢

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 'context:component-scan'.

- schema_reference.4: Failed to read schema document 'http://www.springframework.org/

schema/context/spring-context.xsd', because 1) could not find the document; 2) the document could 

not be read; 3) the root element of the document is not <xsd:schema>.

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'.

- schema_reference.4: Failed to read schema document 'http://www.springframework.org/

schema/tx/spring-tx.xsd', because 1) could not find the document; 2) the document could not be 

read; 3) the root element of the document is not <xsd:schema>.

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 'context:component-scan'.

- schema_reference.4: Failed to read schema document 'http://www.springframework.org/

schema/context/spring-context.xsd', because 1) could not find the document; 2) the document could 

not be read; 3) the root element of the document is not <xsd:schema>.


写回答

2回答

翔仔

2018-03-13

同学本地安装好maven和jdk8之后,需要与你的eclipse相关插件进行对接,

eclipse->偏好设置里,按照如下截图去配置,路径替换成自己的maven和jdk路径

//img.mukewang.com/szimg/5aa7e7480001989014041066.jpg

//img.mukewang.com/szimg/5aa7e748000117a914041066.jpg

配置完成之后,去到截图上面那个local repository的地址下把所有jar全部清空,之后右键项目选择的update maven project重新下载一次jar包即可,一般就没问题了,如果嫌下载速度慢,可以更换maven镜像,具体可以在网上找一下

0
1
KaWhi_Lin
非常感谢!翔哥牛逼!
2018-03-15
共1条回复

翔仔

2018-03-13

同学好,感觉是配置的问题,请对照下表头

<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:tx="http://www.springframework.org/schema/tx"
    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/tx
    http://www.springframework.org/schema/tx/spring-tx.xsd">


0
2
翔仔
回复
KaWhi_Lin
感谢同学提供详细的方便定位的信息,如果是这样的话就是和同学的maven配置有点联系了,eclipse里有maven的插件,需要和你本地安装好的maven对接起来才能使用 具体我贴截图给同学,同学检查下,同学在这之前需要确保本地已经安装好了java还有maven哈
2018-03-13
共2条回复

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程