读书人

org.springframework.beans.factory.B

发布时间: 2012-08-07 14:54:47 作者: rapoo

org.springframework.beans.factory.BeanDefinitionStoreException 怪异问题

org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml];
nested exception is java.io.FileNotFoundException:
Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

但是applicationContext.xml是在我的src路径下,而不是/WEB-INF下,是其他问题引起的吗?


[解决办法]
spring默认回去WEB-INF下去找,你在web.xml中配置:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext*.xml</param-value>
</context-param>
就可以了。

读书人网 >Web开发

热点推荐