問題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中的檔案并沒有相應的版本号導緻出錯,解決方案就是加上相應的版本号:如
轉載于:https://my.oschina.net/u/1011659/blog/203770