Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-20705

Unable to reload logback.xml again after exception in reading the XML

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: 4 - Normal
    • Resolution: Done
    • Affects Version/s: 6.14.2
    • Fix Version/s: 6.17.0
    • Component/s: logback.xml
    • Labels:
      None
    • Severity:
      Medium

      Description

      Steps to reproduce:
      1. While Artifactory is running, modify the logback.xml and enter non-xml format, for example:
      instead of:

      <configuration debug="false">

      put:

      <!!configuration debug="false">

      2. You will see the following expected exception in stdout:

      Exception in thread "logback-watchdog" java.lang.RuntimeException: Failed to build dom document
      	at org.artifactory.util.XmlUtils.parse(XmlUtils.java:70)
      	at org.artifactory.logging.sumo.logback.SumoLogbackUpdater.removeSumoLogicFromXml(SumoLogbackUpdater.java:126)
      	at org.artifactory.logging.sumo.SumoLogicServiceImpl.doAction(SumoLogicServiceImpl.java:482)
      	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
      	at org.jfrog.common.logging.logback.servlet.LogbackNotifier.runJobs(LogbackNotifier.java:30)
      	at org.jfrog.common.logging.logback.servlet.LogbackConfigManager$LogbackConfigWatchDog.doOnChange(LogbackConfigManager.java:145)
      	at org.jfrog.common.util.FileWatchDog.checkAndConfigure(FileWatchDog.java:86)
      	at org.jfrog.common.util.FileWatchDog.run(FileWatchDog.java:106)
      Caused by: org.jdom2.input.JDOMParseException: Error on line 2: The markup in the document preceding the root element must be well-formed.
      	at org.jdom2.input.sax.SAXBuilderEngine.build(SAXBuilderEngine.java:232)
      	at org.jdom2.input.sax.SAXBuilderEngine.build(SAXBuilderEngine.java:303)
      	at org.jdom2.input.SAXBuilder.build(SAXBuilder.java:1196)
      	at org.artifactory.util.XmlUtils.parse(XmlUtils.java:68)
      	... 7 more
      Caused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 3; The markup in the document preceding the root element must be well-formed.
      	at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)
      	at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:178)
      	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
      	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
      	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1471)
      	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:856)
      	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
      	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
      	at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
      	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
      	at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
      	at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
      	at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
      	at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
      	at org.jdom2.input.sax.SAXBuilderEngine.build(SAXBuilderEngine.java:217)
      	... 10 more

      3. Try to fix the format of the logback.xml and save the file.

      It will not reload again in Artifactory. The only way to fix it now is to restart the server.

        Attachments

          Activity

            People

            Assignee:
            avivb Aviv Blonder
            Reporter:
            avivb Aviv Blonder
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Sync Status

                Connection: RTFACT Sync
                RTMID-20705 -
                SYNCHRONIZED
                • Last Sync Date: