• Caused by: org.xml.sax.SAXParseException; lineNumber: 102; columnNumber: 25; cvc-complex-type.2.4.b:


    1、错误描述

    2017-01-19 17:11:05,206 [localhost-startStop-1] ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
      org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 102 in XML document from URL [file:/F:/Tomcat/apache-tomcat-7.0.69/webapps/cmp/WEB-INF/classes/ApplicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 102; columnNumber: 25; cvc-complex-type.2.4.b: 元素 'task:scheduled-tasks' 的内容不完整。应为 '{"http://www.springframework.org/schema/task":scheduled}' 之一。
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:540)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:454)
    	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)
    	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)
    	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260)
    	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: org.xml.sax.SAXParseException; lineNumber: 102; columnNumber: 25; cvc-complex-type.2.4.b: 元素 'task:scheduled-tasks' 的内容不完整。应为 '{"http://www.springframework.org/schema/task":scheduled}' 之一。
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
    	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
    	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:458)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3237)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(XMLSchemaValidator.java:3213)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3160)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:3062)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2140)
    	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:859)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2973)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
    	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)
    	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:347)
    	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:76)

    2、错误原因

    <task:scheduled-tasks>   
            <!--<task:scheduled ref="taskJob" method="getJob" cron="0/10 * * * * ?"/> -->
    </task:scheduled-tasks> 
          将定时器注释掉,这时定时器标签内无内容导致报错

    3、解决办法

    <!--
    <task:scheduled-tasks>   
            <task:scheduled ref="taskJob" method="getJob" cron="0/10 * * * * ?"/> 
    </task:scheduled-tasks>
    --> 


  • 相关阅读:
    dedecms 标签的基本用法
    修改config.php配置
    截取字符
    preg_replace 方法
    php过滤HTML标签、属性等正则表达式汇总
    各种正则验证
    解决问题 “You don't have permission to access /index.html on this server.”
    zend frameword 基本语法
    创建zend framework 项目要注意的
    PHP中级篇 Apache配置httpd-vhosts虚拟主机总结及注意事项[OK]
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13313963.html
Copyright © 2020-2023  润新知