使用spring過程當中遇到:小問題

問題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
相關文章
相關標籤/搜索