`

Cause: org.xml.sax.SAXParseException: The content of element type "configuration

 
阅读更多

Caused by: org.xml.sax.SAXParseException: The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,mappers?)".
 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
 at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
 at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
 at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
 at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2017)
 at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:901)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
 at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:232)
 at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
 at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:236)
 ... 57 more
2014-03-23 15:55:00.877:WARN:oejw.WebAppContext:Failed startup of context o.m.j.p.JettyWebAppContext{/mideaAdmin,file:/D:/java/work/workspace/midea-manager-web/src/main/webapp/},file:/D:/java/work/workspace/midea-manager-web/src/main/webapp/
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in URL [file:/D:/java/work/workspace/midea-manager-web/target/classes/spring/spring-common-config.xml]: Invocation of init method failed; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException: The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,mappers?)".
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
 at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
 at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
 at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
 at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by:
org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException: The content of element type "configuration" must match "(properties?,settings?,typeAliases?,typeHandlers?,objectFactory?,objectWrapperFactory?,plugins?,environments?,mappers?)".
 at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:238)
 at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:107)
 at org.apache.ibatis.builder.xml.XMLConfigBuilder.<init>(XMLConfigBuilder.java:52)
 at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:287)
 at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:269)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
 at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
 at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:699)
 at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:454)
 at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:256)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
 at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167)
 at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)

 

解决方案:
原因是因为当Spring容器启动时,加载mybatis.xml配置文件
发现配置文件中的配置的元素并不是按照
properties,
settings,
typeAliases,
typeHandlers,
objectFactory,
objectWrapperFactory,
plugins,
environments,
mappers
这种顺序定义的.

所以,启动的时候就会报错,只需要把配置改成按照Mybatis里面定义的顺序即可。重新启动服务,问题解决.

分享到:
评论

相关推荐

    org.xml.sax.SAXException: Invalid element

    NULL 博文链接:https://wilian.iteye.com/blog/1992365

    java.lang.ClassNotFoundException: org.jdom.input.SAXBuilder 处理

    SAXBuilder是基于SAX(Simple API for XML)的解析器,SAX是一种事件驱动的XML解析模型,相较于DOM(Document Object Model)更节省内存。SAXBuilder允许开发者用SAX解析器的效率来构建JDOM对象。例如,以下代码展示...

    java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion问题解决方法

    在这个特定的情况下,错误提示`org.apache.xerces.dom.DocumentImpl.setXmlVersion`指出问题源于Apache Xerces的DOM实现,它是一个流行的XML解析库。 `AbstractMethodError`通常意味着缺少了某个依赖或版本冲突。...

    使用Sax技术读XML文档:SaxReaderXML.rar

    import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; public class MyContentHandler extends DefaultHandler { @Override public void startElement...

    android layout XML解析错误的解决方法

    首先,让我们来看看标题和描述中提到的具体错误:"org.xmlpull.v1.XmlPullParserException: PI must not start with xml" 和 "org.xml.sax.SAXParseException: PI must not start with xml"。这两个错误都是由于XML...

    logisim271.zip

    电路模拟神器,轻量级,汉化版,logisim简单的说就是一个设计虚拟电路的软件,它可以将预先将一些电路设计出来,作为模拟与验证之用,很多从事这方面教育的人会用的比较多,学习计算机的同学大二的数字逻辑和大三的...

    Java解析XML文档(二):sax读取xml文件导出excel

    首先,创建一个继承自`org.xml.sax.helpers.DefaultHandler`的类,重写其中的方法,如`startElement()`、`endElement()`和`characters()`,以处理XML元素的开始、结束和字符数据。 2. **注册解析器**: 使用`org....

    解析XML所需的jar sax.jar

    1. **SAX解析器接口**:`org.xml.sax.XMLReader`是SAX解析器的核心接口,它负责读取XML文档并触发事件。 2. **内容处理器**:在SAX解析过程中,我们需要实现`org.xml.sax.ContentHandler`接口,该接口定义了一系列...

    Matlab高阶谱分析(HOSA)工具箱及安装方法

    org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'area'. One of '{MathWorksID, type}' is expected. 运行hosaver: Warning: Could not find an exact ...

    java调用net开发的webservice实例

    javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: org.xml.sax.SAXParseException: The element type "p" must be terminated by the matching end-tag ...

    xml.rar_site:www.pudn.com

    5. **DTD(Document Type Definition)和XSD(XML Schema)**:XML文档可以通过DTD或XSD来定义其结构和数据类型,确保文档的合法性。 6. **样式表(CSS/XTSL)**:通过CSS控制XML文档的显示样式,通过XSLT进行数据...

    使用Sax方法读XML文档:SaxReaderXML.zip

    SAX(Simple API for XML)是处理XML文档的一种事件驱动模型,它以流式方式解析XML,对XML文档进行逐个元素的读取,而不是一次性加载整个文档到内存中,因此对于大型XML文件,SAX解析器比DOM(Document Object Model...

    java操作xml dom dom4j sax jdom

    在JDOM中,你可以通过`SAXBuilder`解析XML,然后使用`getRootElement()`获取根元素,再利用`getChild()`和`addContent()`等方法操作XML结构。 以上四种方式各有优缺点,DOM适合小文件并要求快速访问任何部分,SAX...

    sax解析xml本地读取xml

    1. **初始化解析器**:首先,我们需要创建一个SAX解析器实例,这通常通过实现`org.xml.sax.XMLReader`接口或使用`javax.xml.parsers.SAXParserFactory`类来完成。 2. **设置事件处理器**:SAX解析器在解析XML文档时...

    sax的jar包,xml

    1. **导入所需库**:首先,需要在代码中导入SAX解析器的类,例如`org.xml.sax.XMLReader`和`org.xml.sax.helpers.DefaultHandler`。 2. **创建事件处理器**:定义一个继承自`DefaultHandler`的类,重写其中的回调...

    解决dubbo启动的时候报错,无法读取方案文档 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd'

    解决启动dubbo项目的时候出现,无法读取方案文档 'http://code.alibabatech.com/schema/dubbo/dubbo.xsd',其实在你本地把dubbo.jar文件解压,然后在META-INF下边就有个dubbo.xsd,就是他

    j2ee10:xml01:dom解析和sax解析

    在Java中,使用SAX解析器(如`org.xml.sax.helpers.DefaultHandler`)可以实现SAX解析。以下是一个简单的SAX解析示例: ```java import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml....

    一个关于sax解析xml的demo

    2. 创建一个实现了`org.xml.sax.helpers.DefaultHandler`接口的类,覆盖上述提到的事件处理器方法,定义具体的业务逻辑。 3. 实例化`SAXParserFactory`,并调用`newSAXParser()`方法创建`SAXParser`对象。 4. 使用`...

    SAX_XML.rar_XML SAX_sax xml_xml

    SAX(Simple API for XML)是XML解析器的一种,它以事件驱动的方式解析XML文档,而非DOM(Document Object Model)解析器那样将整个XML文档加载到内存中。SAX解析器在处理大型XML文件时更高效,因为它只在需要时读取...

    SAX编程技术

    通过实现`org.xml.sax.helpers.DefaultHandler`接口或其子接口,开发者可以定制XML解析逻辑,使JSP能够根据实时数据做出响应。 例如,一个JSP页面可能需要读取远程服务器上的XML天气预报数据,使用SAX解析器可以...

Global site tag (gtag.js) - Google Analytics