se7en_q的博客

我是IT界的菜鸟,大神们多多指教

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/spring-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/spring-servlet.xml]
	org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
	org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
	org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
	org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
	org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
	org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
	org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
	org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
	org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
	org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
	org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:651)
	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:599)
	org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:665)
	org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:518)
	org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:459)
	org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
	javax.servlet.GenericServlet.init(GenericServlet.java:212)
	org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
	org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
	org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	java.lang.Thread.run(Thread.java:745)

	在spring-servlet中添加<context:component-scan base-package="com.venustech.controller"/> 这样就可以扫描到控制器中的内容了,可是我已经在application-context.xml中加入了<context:component-scan base-package="com.venustech"/>为什么还要在sppring-servlet中加呢?不过我把application-context.xml中删除掉这句时照样跳过去了!看来这句话得加在spring-servlet.xml中了.
	注意了,这里的spring 是对应我web.xml中的设置的spring转换器中的servlet-name.
	等我把spring mvc理解透彻时就把spring data jpa加进去也许那application-context.xml就要改咯!
阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/se7en_q/article/details/46788065
个人分类: Spring MVC
上一篇错误 loader constraint violation: when resolving interface method &quot;javax.servlet.jsp.JspApplicat
下一篇Spring MVC接收参数的方式
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭