org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 3702 in XML document from ServletContext resource [/WEB-INF/spring/enterpriseReportEngineApp-spring-config-si.xml] is invalid; nested exception is org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/integration/spring-integration.xsd; lineNumber: 3702; 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.

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • error logs:: {noformat} org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [enterpriseReportEngineApp-spring-config-si.xml] Offending resource: ServletContext resource [/WEB-INF/spring/enterpriseReportEngineApp-spring-config.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 3702 in XML document from ServletContext resource [/WEB-INF/spring/enterpriseReportEngineApp-spring-config-si.xml] is invalid; nested exception is org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/integration/spring-integration.xsd; lineNumber: 3702; 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. at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:272) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:197) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:182) {noformat} jars:: {code:xml} <dependency> <groupId>org.springframework.integration</groupId> <artifactId>spring-integration-core</artifactId> <version>2.2.4.RELEASE</version> </dependency> <dependency> <groupId>groovy-all</groupId> <artifactId>groovy-all</artifactId> <version>2.1.6</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/groovy-all-2.1.6.jar</systemPath> </dependency> <dependency> <groupId>spring-integration-groovy</groupId> <artifactId>spring-integration-groovy</artifactId> <version>2.2.4.RELEASE</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/spring-integration-groovy-2.2.4.RELEASE.jar</systemPath> </dependency> <dependency> <groupId>spring-integration-scripting</groupId> <artifactId>spring-integration-scripting</artifactId> <version>2.2.4.RELEASE</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/spring-integration-scripting-2.2.4.RELEASE.jar</systemPath> </dependency> {code} {{enterpriseReportEngineApp-spring-config-si.xml}} :: {code:xml} <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:int="http://www.springframework.org/schema/integration" xmlns:int-jms="http://www.springframework.org/schema/integration/jms" xmlns:int-stream="http://www.springframework.org/schema/integration/stream" xmlns:int-groovy="http://www.springframework.org/schema/integration/groovy" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.1.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/integration/jms http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd http://www.springframework.org/schema/integration/groovy http://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd"> <int:channel id="outputChannel" /> <int:gateway id="reportEngineGateway" service-interface="com.bnym.ecs.report.service.V2.preprocessor.impl.ReportEngineGateway" default-reply-channel="outputChannel"> <int:method name="processAsyncMsgExcution" request-channel="executeMsgChannel" /> </int:gateway> <int:service-activator input-channel="executeMsgChannel" output-channel="nullChannel" ref="reportEngineADHRestHelper" method="execute" > </int:service-activator> <!-- <int:channel id="executeMsgChannel"> <int:dispatcher task-executor="v2ThreadPooltaskExecutor" /> </int:channel> --> <int:channel id="outputChannel"> <int:queue capacity="10" /> </int:channel> </beans> {code}
    via by Prashant Katiyar,
  • error logs:: {noformat} org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [enterpriseReportEngineApp-spring-config-si.xml] Offending resource: ServletContext resource [/WEB-INF/spring/enterpriseReportEngineApp-spring-config.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 3702 in XML document from ServletContext resource [/WEB-INF/spring/enterpriseReportEngineApp-spring-config-si.xml] is invalid; nested exception is org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/integration/spring-integration.xsd; lineNumber: 3702; 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. at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:272) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:197) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:182) {noformat} jars:: {code:xml} <dependency> <groupId>org.springframework.integration</groupId> <artifactId>spring-integration-core</artifactId> <version>2.2.4.RELEASE</version> </dependency> <dependency> <groupId>groovy-all</groupId> <artifactId>groovy-all</artifactId> <version>2.1.6</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/groovy-all-2.1.6.jar</systemPath> </dependency> <dependency> <groupId>spring-integration-groovy</groupId> <artifactId>spring-integration-groovy</artifactId> <version>2.2.4.RELEASE</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/spring-integration-groovy-2.2.4.RELEASE.jar</systemPath> </dependency> <dependency> <groupId>spring-integration-scripting</groupId> <artifactId>spring-integration-scripting</artifactId> <version>2.2.4.RELEASE</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/spring-integration-scripting-2.2.4.RELEASE.jar</systemPath> </dependency> {code} {{enterpriseReportEngineApp-spring-config-si.xml}} :: {code:xml} <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:jms="http://www.springframework.org/schema/jms" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:int="http://www.springframework.org/schema/integration" xmlns:int-jms="http://www.springframework.org/schema/integration/jms" xmlns:int-stream="http://www.springframework.org/schema/integration/stream" xmlns:int-groovy="http://www.springframework.org/schema/integration/groovy" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.1.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/integration/jms http://www.springframework.org/schema/integration/jms/spring-integration-jms.xsd http://www.springframework.org/schema/integration/stream http://www.springframework.org/schema/integration/stream/spring-integration-stream.xsd http://www.springframework.org/schema/integration/groovy http://www.springframework.org/schema/integration/groovy/spring-integration-groovy.xsd"> <int:channel id="outputChannel" /> <int:gateway id="reportEngineGateway" service-interface="com.bnym.ecs.report.service.V2.preprocessor.impl.ReportEngineGateway" default-reply-channel="outputChannel"> <int:method name="processAsyncMsgExcution" request-channel="executeMsgChannel" /> </int:gateway> <int:service-activator input-channel="executeMsgChannel" output-channel="nullChannel" ref="reportEngineADHRestHelper" method="execute" > </int:service-activator> <!-- <int:channel id="executeMsgChannel"> <int:dispatcher task-executor="v2ThreadPooltaskExecutor" /> </int:channel> --> <int:channel id="outputChannel"> <int:queue capacity="10" /> </int:channel> </beans> {code}
    via by Prashant Katiyar,
  • Spring Camel Email Configuration Issue
    via Stack Overflow by Pankaj.Java
    ,
  • How to declare a parent application context
    via Stack Overflow by Samo
    ,
  • With the splitting of Spring Framework into multiple jar files in v3.0, there are now several files named "META-INF/spring.handlers", "spring.schemas" and "spring.tooling". This is not a problem when running in a normal servlet container, but poses problems when e.g. creating an executable JAR file from a webapp using an embedded web server such as Jetty, or running GWT in "Dev Mode", which uses a custom class loader. In the former scenario, a typical approach is to use a Maven assembly to extract all .class files from the project dependencies and merge them into one hierarchy, as a way of packaging all the dependencies and the webapp itself into one JAR file. However, in this case only one copy of "spring.handlers/schemas/tooling" can exist, and so any schemas that are used and /not/ in the one copy cannot be validated. This leads to exceptions such as this one: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 65 in XML document from class path resource [spring/beans.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:annotation-config'. at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:218) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147) Other people reporting similar problems can be found at Stack Overflow here and here. The workaround is to construct your own "custom" version of these three files, merging all the copies into one like so: //IOUtils and FileUtils come from Apache Commons IOfor(String s : new String[] {"spring.schemas", "spring.handlers", "spring.tooling"}) { Enumeration<?> e = Test.class.getClassLoader().getResources("META-INF/"+s); StringBuilder out = new StringBuilder();while(e.hasMoreElements()) { URL u = (URL) e.nextElement(); out.append(IOUtils.toString(u.openStream())).append("\n"); } File outf = new File(s); FileUtils.writeStringToFile(outf, out.toString(), "UTF-8"); } However, the proper fix would be to use a different file-name for each instance of the schemas/handlers/tooling files. For example, inside "org.springframework.aop-3.0.5.RELEASE.jar/META-INF" you would find "spring-aop.schemas", "spring-aop.handlers" and "spring-aop.tooling". I'm afraid I'm not sufficiently up-to-speed with the Spring code-base to give you a patch to do this, however a brief investigation shows that "spring.handlers" and "spring.schemas" are specified in org.springframework.beans.factory.xml.PluggableSchemaResolver and DefaultNamespaceHandlerResolver, and that constructors exist for specifying different locations for these files. I hope you find this information useful. Best regards, - Ian
    via by Ian Sollars,
    • org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 3702 in XML document from ServletContext resource [/WEB-INF/spring/enterpriseReportEngineApp-spring-config-si.xml] is invalid; nested exception is org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/integration/spring-integration.xsd; lineNumber: 3702; 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. at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:272) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:197) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:182)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,