Uploaded image for project: 'AMQ Broker'
  1. AMQ Broker
  2. ENTMQBR-2625

Broker.xml is order sensitive - throws SAX parser exception, when tag is not at precise position

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • AMQ 7.3.0.GA, AMQ 7.4.0.GA
    • configuration
    • None
    • Documentation (Ref Guide, User Guide, etc.), Compatibility/Configuration, User Experience
    • Hide

      Set up cluster configuration.
      Move <reconnect-attempts>-1</reconnect-attempts> to any other line inside <cluster-connection> tag.

      Show
      Set up cluster configuration. Move <reconnect-attempts>-1</reconnect-attempts> to any other line inside <cluster-connection> tag.

    Description

      When I was trying to put reconnect-attempts into cluster-connections tag, I have failed multiple times to start broker. Everytime it failed with SAX exception below. This is very strange issue and not documented at all. I have tried to put any other option from bridgeType definition of artemis-configuration.xsd file, but it always failed with the error, unless added to the one precise placement.

      This is present in 7.3.0 and 7.4.0 (haven't tried older versions).

       <cluster-connections>
                  <cluster-connection name="artemis-cluster">
                      <connector-ref>cluster-connector</connector-ref>
                      <reconnect-attempts>-1</reconnect-attempts> <!-- works in this exact position, anywhere else it fails -->
                      <message-load-balancing>ON_DEMAND</message-load-balancing>
                      <max-hops>1</max-hops>
                      <discovery-group-ref discovery-group-name="cluster-discovery-group"/>
                  </cluster-connection>
              </cluster-connections>
      
      2019-06-27 11:27:04,377 ERROR [org.apache.activemq.artemis.core.client] AMQ214019: Invalid configuration: org.xml.sax.SAXParseException; cvc-complex-type.2.4.d: Invalid content was found starting with element 'reconnect-attempts'. No child element is expected at this point.
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:453) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3231) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1795) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:277) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:244) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:190) [rt.jar:1.8.0_202]
      	at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:109) [rt.jar:1.8.0_202]
      	at javax.xml.validation.Validator.validate(Validator.java:124) [rt.jar:1.8.0_202]
      	at org.apache.activemq.artemis.utils.XMLUtil.validate(XMLUtil.java:331) [artemis-core-client-2.7.0.redhat-00055.jar:2.7.0.redhat-00055]
      	at org.apache.activemq.artemis.core.config.FileDeploymentManager.readConfiguration(FileDeploymentManager.java:85) [artemis-server-2.7.0.redhat-00055.jar:2.7.0.redhat-00055]
      	at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:61) [artemis-cli-2.7.0.redhat-00055.jar:2.7.0.redhat-00055]
      	at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:85) [artemis-cli-2.7.0.redhat-00055.jar:2.7.0.redhat-00055]
      	at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:150) [artemis-cli-2.7.0.redhat-00055.jar:2.7.0.redhat-00055]
      	at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:98) [artemis-cli-2.7.0.redhat-00055.jar:2.7.0.redhat-00055]
      	at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:125) [artemis-cli-2.7.0.redhat-00055.jar:2.7.0.redhat-00055]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_202]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_202]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_202]
      	at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_202]
      	at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:129) [artemis-boot.jar:2.7.0.redhat-00055]
      	at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:49) [artemis-boot.jar:2.7.0.redhat-00055]
      
      java.lang.IllegalStateException: Invalid configuration
      	at org.apache.activemq.artemis.utils.XMLUtil.validate(XMLUtil.java:335)
      	at org.apache.activemq.artemis.core.config.FileDeploymentManager.readConfiguration(FileDeploymentManager.java:85)
      	at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:61)
      	at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:85)
      	at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:150)
      	at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:98)
      	at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:125)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:129)
      	at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:49)
      Caused by: org.xml.sax.SAXParseException; cvc-complex-type.2.4.d: Invalid content was found starting with element 'reconnect-attempts'. No child element is expected at this point.
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:453)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3231)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1795)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741)
      	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:277)
      	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:244)
      	at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:190)
      	at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:109)
      	at javax.xml.validation.Validator.validate(Validator.java:124)
      	at org.apache.activemq.artemis.utils.XMLUtil.validate(XMLUtil.java:331)
      	... 12 more
      

      Possible solution might be, to update bridgeType xsd:sequence -> xsd:all (and some other updates on XMLs, as that did not work that simply for me).

      Attachments

        Issue Links

          Activity

            People

              rh-ee-ataylor Andy Taylor
              mtoth@redhat.com Michal Toth
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: