The constructor ClassPathXmlApplicationContext(String) refers to the missing type
首次学习Spring Framework,通过Maven加入如下依赖:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
然后写一个简单的Hello World,准备从配置文件中得到Bean,出现如下错误:
“The constructor ClassPathXmlApplicationContext(String) refers to the missing type BeansException”
原因是虽然加入spring-core,spring-beans等依赖包,但是却没有正确的下载,可以点击发现下面没有对应的package,所以手动进入repository删除对应目录,让它重新更新!
这样就OK了!