Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-6520

Fix project build with malformed XML Extension feature

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.6.4
    • Fix Version/s: 2023.2.0
    • Component/s: Builders

      Description

      When a user XML extension is malformed (i.e contains wrong XML), it displays a validation error (which is fine), but if you still hit the Download package button, it ends up with a 500 error : https://app.datadoghq.com/logs?query=staging%3Aprod%20%20status%3Aerror&cols=core_host%2Ccore_service&event=AQAAAXtzGzfzl7NZZQAAAABBWHR6RzBZSUFBREhaSUpFOE8tdmVRQUI&index=%2A&messageDisplay=inline&stream_sort=desc&type=logs&from_ts=1629722882609&to_ts=1629723782609&live=true

      org.dom4j.DocumentException: Error on line 1 of document  : The element type "xmlContent" must be terminated by the matching end-tag "</xmlContent>".
      	at org.dom4j.io.SAXReader.read(SAXReader.java:511) ~[dom4j-2.1.3.jar:?]
      	at org.dom4j.io.SAXReader.read(SAXReader.java:408) ~[dom4j-2.1.3.jar:?]
      	at com.nuxeo.studio.core.builders.XmlFeatureBuilder.getXMLDocument(XmlFeatureBuilder.java:65) ~[nuxeo-studio-ui-4.6.4-v4.6.4.jar:?]
      	at com.nuxeo.studio.core.builders.XmlFeatureBuilder.build(XmlFeatureBuilder.java:41) ~[nuxeo-studio-ui-4.6.4-v4.6.4.jar:?]
      	at com.nuxeo.studio.core.builders.XmlFeatureBuilder.build(XmlFeatureBuilder.java:33) ~[nuxeo-studio-ui-4.6.4-v4.6.4.jar:?]
      	at com.nuxeo.studio.core.buildservices.BuildServiceImpl.doBuild(BuildServiceImpl.java:164) ~[nuxeo-studio-ui-4.6.4-v4.6.4.jar:?]
      	at com.nuxeo.studio.core.buildservices.BuildServiceImpl.build(BuildServiceImpl.java:114) ~[nuxeo-studio-ui-4.6.4-v4.6.4.jar:?]
      Caused by: org.xml.sax.SAXParseException: The element type "xmlContent" must be terminated by the matching end-tag "</xmlContent>".
      	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
      	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
      	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
      	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
      	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
      	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
      	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
      	at org.dom4j.io.SAXReader.read(SAXReader.java:494) ~[dom4j-2.1.3.jar:?]
      	at org.dom4j.io.SAXReader.read(SAXReader.java:408) ~[dom4j-2.1.3.jar:?]
      	at com.nuxeo.studio.core.builders.XmlFeatureBuilder.getXMLDocument(XmlFeatureBuilder.java:65) ~[nuxeo-studio-ui-4.6.4-v4.6.4.jar:?]
      	at com.nuxeo.studio.core.builders.XmlFeatureBuilder.build(XmlFeatureBuilder.java:41) ~[nuxeo-studio-ui-4.6.4-v4.6.4.jar:?]
      	at com.nuxeo.studio.core.builders.XmlFeatureBuilder.build(XmlFeatureBuilder.java:33) ~[nuxeo-studio-ui-4.6.4-v4.6.4.jar:?]
      	at com.nuxeo.studio.core.buildservices.BuildServiceImpl.doBuild(BuildServiceImpl.java:164) ~[nuxeo-studio-ui-4.6.4-v4.6.4.jar:?]
      	at com.nuxeo.studio.core.buildservices.BuildServiceImpl.build(BuildServiceImpl.java:114) ~[nuxeo-studio-ui-4.6.4-v4.6.4.jar:?]
      	... 94 more
      

      It should instead ignore the wrong XML extension and process the others.

      Another thing to take into account is the generation of the Studio registries for the project, we should also ensure that a wrong XML extension don't break them.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: