在 Spring MVC 中我无法运行我的服务器
`
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)at javax.servlet.GenericServlet.init(GenericServlet.java:158)at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164)at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1117)at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5264)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.startup.Catalina.start(Catalina.java:772)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.base/java.lang.reflect.Method.invoke(Method.java:568)at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/spring-servlet.xml]at
org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:1
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
`
在 TOmCAT 服务器中。我无法运行该项目。?
`
严重:Web 应用程序 [/SpringMvc4] 中的 Servlet [spring] 抛出 load() 异常java.io.FileNotFoundException:无法在 org.springframework.web.context 打开 ServletContext 资源 [/WEB-INF/spring-servlet.xml]。 support.ServletContextResource.getInputStream(ServletContextResource.java:118)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)在org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext( FrameworkServlet.java:443)at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)在org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)在org.springframework.web.servlet.FrameworkServlet.initServletBean( FrameworkServlet.java:307)at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)在 javax.servlet.GenericServlet.init(GenericServlet.java:158)在 org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:第1164章) org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1117)在 org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)在 org.apache.catalina.core.StandardContext.loadOnStartup( StandardContext.java:4957)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5264)在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)在org.apache.catalina.core.ContainerBase$StartChild。致电(ContainerBase.java:1396) org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)在java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)在org.apache.tomcat.util。线程.InlineExecutorService.execute(InlineExecutorService.java:75)at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)在org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)在org.apache.catalina.core.StandardHost。 startInternal(StandardHost.java:835)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)在 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)在 org.apache.catalina.core.ContainerBase$ StartChild.call(ContainerBase.java:1386)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)在org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)在java.base/java.util。并发.AbstractExecutorService.submit(AbstractExecutorService.java:145)at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)在org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)在org.apache.catalina.util.LifecycleBase.start( LifecycleBase.java:183)at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)在org.apache.catalina.core.StandardServer.startInternal( StandardServer.java:927)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)在org.apache.catalina.startup.Catalina.start(Catalina.java:772)在java.base/jdk.internal.reflect.NativeMethodAccessorImpl。 invoke0(本机方法)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)在
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在 java.base/java.lang.reflect.Method.invoke(Method.java:568) 在 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345) 在 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)`
`
`
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)at javax.servlet.GenericServlet.init(GenericServlet.java:158)at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164)at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1117)at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5264)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.startup.Catalina.start(Catalina.java:772)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.base/java.lang.reflect.Method.invoke(Method.java:568)at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/spring-servlet.xml]at
org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:1
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
`
In TOmCAT Server.I can't able to run the project.?
`
SEVERE: Servlet [spring] in web application [/SpringMvc4] threw load() exceptionjava.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/spring-servlet.xml]at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:118)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465)at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395)at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)at javax.servlet.GenericServlet.init(GenericServlet.java:158)at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164)at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1117)at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1010)at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5264)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.StandardService.startInternal(StandardService.java:432)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.startup.Catalina.start(Catalina.java:772)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:476)`
`
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您的
spring-servlet.xml
在web.xml
中正确引用。Make sure that your
spring-servlet.xml
is referenced properly inweb.xml
.