问题原因:spring约束,导致.xsd文件导入失败
解决措施:
1:确保Spring配置文件的头信息导入正确(我的是spring4.0)
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
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-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">
</beans>
2:bean标签内即为相应.xsd的链接
3:添加.xsd的配置
Windows-->preference-->xml-->xml catalog
查看是否有报错信息,有的话,点击右侧edit-->Location 添加.xsd文件的地址即可
无报错信息,则点击右侧 add,添加xsd文件的地址即可 Key type-->URI
Location处为.xsd文件的地址