• Sturts2整合Spring报错:org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml];


    十一月 17, 2019 1:11:44 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
    警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ssh022' did not find a matching property.
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: Server version: Apache Tomcat/7.0.85
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: Server built: Feb 7 2018 18:52:33 UTC
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: Server number: 7.0.85.0
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: OS Name: Windows 7
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: OS Version: 6.1
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: Architecture: amd64
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: Java Home: C:Program FilesJavajre1.8.0_131
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: JVM Version: 1.8.0_131-b11
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: JVM Vendor: Oracle Corporation
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: CATALINA_BASE: D:workspace_20190606.metadata.pluginsorg.eclipse.wst.server.core mp2
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: CATALINA_HOME: D:javaeeapache-tomcat-7.0.85
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: Command line argument: -Dcatalina.base=D:workspace_20190606.metadata.pluginsorg.eclipse.wst.server.core mp2
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: Command line argument: -Dcatalina.home=D:javaeeapache-tomcat-7.0.85
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: Command line argument: -Dwtp.deploy=D:workspace_20190606.metadata.pluginsorg.eclipse.wst.server.core mp2wtpwebapps
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: Command line argument: -Djava.endorsed.dirs=D:javaeeapache-tomcat-7.0.85endorsed
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.startup.VersionLoggerListener log
    信息: Command line argument: -Dfile.encoding=UTF-8
    十一月 17, 2019 1:11:44 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
    信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:Program FilesJavajre1.8.0_131in;C:WindowsSunJavain;C:Windowssystem32;C:Windows;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/amd64;E:appAdministratorproduct11.2.0dbhome_1in;C:ProgramDataOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;D:mavenapache-maven-3.6.2in;C:Program FilesMySQLMySQL Shell 8.0in;D:javaseeclipse;;.
    十一月 17, 2019 1:11:45 下午 org.apache.coyote.AbstractProtocol init
    信息: Initializing ProtocolHandler ["http-bio-8080"]
    十一月 17, 2019 1:11:45 下午 org.apache.coyote.AbstractProtocol init
    信息: Initializing ProtocolHandler ["ajp-bio-8009"]
    十一月 17, 2019 1:11:45 下午 org.apache.catalina.startup.Catalina load
    信息: Initialization processed in 1245 ms
    十一月 17, 2019 1:11:45 下午 org.apache.catalina.core.StandardService startInternal
    信息: Starting service Catalina
    十一月 17, 2019 1:11:45 下午 org.apache.catalina.core.StandardEngine startInternal
    信息: Starting Servlet Engine: Apache Tomcat/7.0.85
    十一月 17, 2019 1:11:46 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
    警告: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [204] milliseconds.
    十一月 17, 2019 1:11:47 下午 org.apache.catalina.startup.TldConfig execute
    信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
    十一月 17, 2019 1:11:47 下午 org.apache.catalina.core.ApplicationContext log
    信息: Initializing Spring root WebApplicationContext
    十一月 17, 2019 1:11:47 下午 org.springframework.web.context.ContextLoader initWebApplicationContext
    信息: Root WebApplicationContext: initialization started
    十一月 17, 2019 1:11:47 下午 org.springframework.context.support.AbstractApplicationContext prepareRefresh
    信息: Refreshing Root WebApplicationContext: startup date [Sun Nov 17 13:11:47 CST 2019]; root of context hierarchy
    十一月 17, 2019 1:11:47 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    信息: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
    十一月 17, 2019 1:11:47 下午 org.springframework.web.context.ContextLoader initWebApplicationContext
    严重: Context initialization failed
    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]
    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:467)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5641)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1700)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1690)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
    at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
    ... 21 more

    十一月 17, 2019 1:11:47 下午 org.apache.catalina.core.StandardContext listenerStart
    严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    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]
    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:467)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5641)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1700)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1690)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
    at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328)
    ... 21 more

    十一月 17, 2019 1:11:47 下午 org.apache.catalina.core.StandardContext startInternal
    严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
    十一月 17, 2019 1:11:47 下午 org.apache.catalina.core.StandardContext startInternal
    严重: Context [/ssh022] startup failed due to previous errors
    十一月 17, 2019 1:11:47 下午 org.apache.catalina.core.ApplicationContext log
    信息: Closing Spring root WebApplicationContext
    十一月 17, 2019 1:11:47 下午 org.apache.coyote.AbstractProtocol start
    信息: Starting ProtocolHandler ["http-bio-8080"]
    十一月 17, 2019 1:11:47 下午 org.apache.coyote.AbstractProtocol start
    信息: Starting ProtocolHandler ["ajp-bio-8009"]
    十一月 17, 2019 1:11:47 下午 org.apache.catalina.startup.Catalina start
    信息: Server startup in 2413 ms

    ————————————————————————————————————

    错误原因:web.xml配置文件的 监听spring-*.xml的contextConfigLocation的大小写错误

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
    <display-name>ssh022</display-name>
    <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <context-param>
    <param-name>ContextConfigLocation</param-name>
    <param-value>classpath:spring-*.xml</param-value>
    </context-param>
    <filter>
    <filter-name>mvc</filter-name>
    <filter-class>
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    </filter-class>
    </filter>
    <filter-mapping>
    <filter-name>mvc</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    </web-app>

  • 相关阅读:
    Mr. Frog’s Game(模拟连连看)
    Comparison of Android versions(strcmp的应用)
    Android热门网络框架Volley详解
    Android中你应该知道的设计模式
    从高德 SDK 学习 Android 动态加载资源
    Android中多线程下载列表的封装实现(含进度反馈)
    判断App是否在后台运行
    信息安全领域有哪些非常棒的资源?
    Android应用发布后的统计——百度移动统计的应用
    面试时,问哪些问题能试出一个Android应用开发者真正的水平?
  • 原文地址:https://www.cnblogs.com/renxinghua/p/11876068.html
Copyright © 2020-2023  润新知