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

00潤物無聲00發表於2016-12-28

  在Spring的配置檔案applicationContext.xml中

	<!-- 自動掃描與裝配bean -->
	<context:component-scan base-package="cn.itcast.oa"></context:component-scan> 


當執行tomcat時出現錯誤

  Caused by: 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的版本太低了,tomcat的配置中更換一個低版本的jdk,解決問題。

相關文章