[ 
https://issues.apache.org/activemq/browse/AMQ-929?page=comments#action_37692 ] 
            
Florian Wiesner commented on AMQ-929:
-------------------------------------

With the xsd embedded into the Spring context, I get the following stacktrace:

org.springframework.beans.factory.BeanDefinitionStoreException: Line 4531 in 
XML document from class path resource [resources/junit-application-context.xml] 
is invalid; nested exception is org.xml.sax.SAXParseException: cos-nonambig: 
"http://activemq.org/config/1.0":redeliveryPolicy and WC[##any] (or elements 
from their substitution group) violate "Unique Particle Attribution". During 
validation against this schema, ambiguity would be created for those two 
particles.
Caused by: org.xml.sax.SAXParseException: cos-nonambig: 
"http://activemq.org/config/1.0":redeliveryPolicy and WC[##any] (or elements 
from their substitution group) violate "Unique Particle Attribution". During 
validation against this schema, ambiguity would be created for those two 
particles.
        at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
        at 
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
        at 
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
        at 
com.sun.org.apache.xerces.internal.impl.xs.XSConstraints.reportSchemaError(XSConstraints.java:315)
        at 
com.sun.org.apache.xerces.internal.impl.xs.XSConstraints.fullSchemaChecking(XSConstraints.java:463)
        at 
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2246)
        at 
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:814)
        at 
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
        at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
        at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
        at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
        at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
        at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
        at 
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:250)
        at 
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
        at 
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)
        at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:405)
        at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:357)
        at 
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
        at 
org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73)
        at 
org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61)
        at de.florian_wiesner.TestJMSLogReader.setUp(TestJMSLogReader.java:29)
        at junit.framework.TestCase.runBare(TestCase.java:125)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)


> Invalid XSD (according to XML Spy)
> ----------------------------------
>
>                 Key: AMQ-929
>                 URL: https://issues.apache.org/activemq/browse/AMQ-929
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 4.1.0
>         Environment: N/A
>            Reporter: Stephen Cresswell
>            Priority: Minor
>
> XmlSpy reports 
> http://people.apache.org/repository/org.apache.activemq/xsds/activemq-core-4.1-incubator-SNAPSHOT.xsd
>  is invalid with the following message:
> <xs:element ref='tns:topic'> makes the content model non-deterministic. 
> Possible causes: name equality, overlapping occurance or substitution groups.
> It's complaining because it has no way to validate whether it should validate 
> against tns:topic/tns:queue or the xs:any for the following element
> <xs:element name='destination' minOccurs='0' maxOccurs='1'>
>    <xs:complexType>
>       <xs:choice minOccurs='0' maxOccurs='1'>
>          <xs:element ref='tns:queue'/>
>          <xs:element ref='tns:topic'/>
>          <xs:any/>
>       </xs:choice>
>    </xs:complexType>
> </xs:element>
> Possible fix adapted from 
> http://www.thescripts.com/forum/threadedpost1605613.html:
> <xs:element name="destination" minOccurs="0" maxOccurs="1">
>       <xs:complexType>
>               <xs:choice minOccurs="0" maxOccurs="1">
>                       <xs:element name="extensions">
>                               <xs:sequence maxOccurs="1">
>                                       <xs:any/>                               
>                               </xs:sequence>
>                       </xs:element>
>                       <xs:element ref="tns:queue"/>
>                       <xs:element ref="tns:topic"/>
>               </xs:choice>
>       </xs:complexType>
> </xs:element>
> But I suspect difficult to fix as the XSD is autogenerated + you'll lose 
> backwards compatability with previous documents. The problem occurs 
> repeatedly throughout the schema.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to