Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-9219

Invalid Comments in JSON Configuration

    XMLWordPrintableJSON

Details

    Description

      With the latest version of JCR Installer, I'm seeing an exception when saving OSGi Configurations from the console:

       
      18.03.2020 19:57:44.565 WARN [JcrInstaller.2] org.apache.sling.installer.core.impl.OsgiInstallerImpl Cannot create InternalResource (resource will be ignored):InstallableResource, priority=200, id=/apps/sling/install/org.apache.sling.cms.core.internal.repository.RevisionCleanupScheduler.cfg.jsonjavax.json.stream.JsonParsingException: Unexpected character '#' (Codepoint: 35) on [lineNumber=2, columnNumber=77, streamOffset=76]. Reason is [[Expected structural character or digit or 't' or 'n' or 'f' or '-']]at org.apache.johnzon.core.JsonStreamParserImpl.uexc(JsonStreamParserImpl.java:966)at org.apache.johnzon.core.JsonStreamParserImpl.uexc(JsonStreamParserImpl.java:972)at org.apache.johnzon.core.JsonStreamParserImpl.defaultHandling(JsonStreamParserImpl.java:422)at org.apache.johnzon.core.JsonStreamParserImpl.next(JsonStreamParserImpl.java:414)at org.apache.johnzon.core.JsonStreamParserImpl.next(JsonStreamParserImpl.java:353)at org.apache.johnzon.core.JsonReaderImpl.parseObject(JsonReaderImpl.java:131)at org.apache.johnzon.core.JsonReaderImpl.readValue(JsonReaderImpl.java:56)at org.apache.johnzon.core.JsonReaderImpl.read(JsonReaderImpl.java:42)at org.apache.felix.configurator.impl.json.JSONUtil.parseJSON(JSONUtil.java:331) [org.apache.sling.installer.core:3.10.2]at org.apache.felix.configurator.impl.json.JSONUtil.readJSON(JSONUtil.java:161) [org.apache.sling.installer.core:3.10.2]at org.apache.sling.installer.core.impl.InternalResource.readDictionary(InternalResource.java:274) [org.apache.sling.installer.core:3.10.2]at org.apache.sling.installer.core.impl.InternalResource.create(InternalResource.java:106) [org.apache.sling.installer.core:3.10.2]at org.apache.sling.installer.core.impl.OsgiInstallerImpl.createResources(OsgiInstallerImpl.java:385) [org.apache.sling.installer.core:3.10.2]at org.apache.sling.installer.core.impl.OsgiInstallerImpl.updateResources(OsgiInstallerImpl.java:425) [org.apache.sling.installer.core:3.10.2]at org.apache.sling.installer.provider.jcr.impl.JcrInstaller.runOneCycle(JcrInstaller.java:465) [org.apache.sling.installer.provider.jcr:3.2.0]at org.apache.sling.installer.provider.jcr.impl.JcrInstaller$StoppableThread.run(JcrInstaller.java:287) [org.apache.sling.installer.provider.jcr:3.2.0]

      The problem appears to be that the files are in JSON format, but contain a prefix comment: " # Configuration created by Apache Sling JCR Installer"

      This is due to the JCR Installer changing to write the configuration files in JSON format, but still including the comment from when the configurations were persisted as text files:

      https://github.com/apache/sling-org-apache-sling-installer-provider-jcr/blame/master/src/main/java/org/apache/sling/installer/provider/jcr/impl/JcrInstaller.java#L695

      The question kwin it looks like there was a revert commit, so should the config files revert to TXT format or remove the comment and have the configurations in JSON format?

       
       

      Attachments

        Issue Links

          Activity

            People

              kwin Konrad Windszus
              dklco Dan Klco
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: