zoukankan      html  css  js  c++  java
  • An ''all'' model group must appear in a particle with...问题解决记录

    场景:

      最近在一个新项目的依赖包调整过程中,引入包之后,发现项目启动报错,一直启动不成功,经过查询和排查,发现是包对xml解析冲突的问题;

    报错信息:

    [WARNING] Nested in org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 24 in XML document from URL [file:xxxxxxx/target/classes/web-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd; lineNumber: 24; columnNumber: 20; cos-all-limited.1.2: An ''all'' model group must appear in a particle with '{'min occurs'}'='{'max occurs'}'=1, and that particle must be part of a pair which constitutes the '{'content type'}' of a complex type definition.:
    org.xml.sax.SAXParseException: cos-all-limited.1.2: An ''all'' model group must appear in a particle with '{'min occurs'}'='{'max occurs'}'=1, and that particle must be part of a pair which constitutes the '{'content type'}' of a complex type definition.
        at org.apache.xerces.parsers.DOMParser.parse (DOMParser.java:267)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse (DocumentBuilderImpl.java:201)
        at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument (DefaultDocumentLoader.java:76)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument (XmlBeanDefinitionReader.java:429)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions (XmlBeanDefinitionReader.java:391)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:336)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions (XmlBeanDefinitionReader.java:304)
        at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions (AbstractBeanDefinitionReader.java:181)
    

    排查步骤:   

      1. 是不是报错信息中的xml写错了配置;

      2. 包冲突, 从错误堆栈中可以看到 xerces 包的DOMParser,猜测是 xerces 和 Spring的对于xml的解析出现了冲突,然后将xerces包中项目中排除(包括直接依赖和传递依赖)

    结果:

      发现是包冲突了,去掉common-pool的传递依赖的xerces包,问题解决。

  • 相关阅读:
    iOS添加Google语言识别功能
    转载:Ajax中get与post请求详解
    SSH:Spring+Spring MVC+hibernate整合开发笔记
    IDEA中创建maven web项目的详细部署步骤
    C++实现RTMP协议发送H.264编码及AAC编码的音视频
    C++ 勘误
    Postgresql ODBC驱动,用sqlserver添加dblink跨库访问postgresql数据库
    .Net NPOI 上传excel文件、提交后台获取excel里的数据
    .Net NPOI 根据excel模板导出excel、直接生成excel
    .Net 登陆的时候添加验证码
  • 原文地址:https://www.cnblogs.com/zhuangmingnan/p/9328581.html
Copyright © 2011-2022 走看看