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包,问题解决。

  • 相关阅读:
    SQL Server中行列转换 Pivot UnPivot
    div层拖动
    INamingContainer 接口
    nhibernet并发出错
    百度空间的密码帐号
    委托与事件入门经典
    Left Join、Right Join、Inner Join的区别
    C#操作剪贴板
    hibernate源码分析 持久化原理[摘自JavaEye]
    SQLSERVER条件语句IF应用
  • 原文地址:https://www.cnblogs.com/zhuangmingnan/p/9328581.html
Copyright © 2011-2022 走看看