1. 程式人生 > >Context namespace element 'component-scan' its parser class are only available on JDK 1.5 and higher

Context namespace element 'component-scan' its parser class are only available on JDK 1.5 and higher

執行tomcat的時候,出現下面的錯誤
java.lang.IllegalStateException: Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

原因:主要是因為spring的版本低所導致的問題,但是你可能會有疑問,明明,我的專案中用到的spring的版本明明已經是新版本,怎麼可能存在低版本的問題呢?

此時,你需要檢查你的pom.xml檔案中是否有使用的到dubbo,因為dubbo一來了一箇舊版本的spring,所以導致此問題發生;解決方案如下:
配置忽略dubbo中的spring版本