问题1:
- cvc-elt.1: Cannot find the declaration of element 'beans'.
这个是因为spring的jar包与applicationContext.xml中xsd的 版本不一样 形成的。我刚开始的配置是这样的:
<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:aop="http://www.springframework.org/schema/aop"
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
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
schemaLocation中的文件并无相应的版本号致使出错,解决方案就是加上相应的版本号:如
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd