Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-118883

Failed to deploy AntiSamy configuration due to 'Unable to initialize policy'

Details

    • 3
    • Iteration 44
    • Regression Bug

    Description

      When trying to deploy AntiSamy configuration file using Gradle, will occur the below error.

      !ENTRY org.apache.felix.configadmin 4 0 2020-08-11 00:29:13.628
      !MESSAGE [org.osgi.service.cm.ManagedServiceFactory, id=705, bundle=310/file:/opt/dev/projects/github/liferay-portal/bundles/osgi/portal/com.liferay.portal.security.antisamy.jar]: Unexpected problem updating configuration com.liferay.portal.security.antisamy.configuration.AntiSamyClassNameConfiguration.0f30ca1d-4909-4a84-804b-be89487c4035
      !STACK 0
      java.lang.IllegalStateException: Unable to initialize policy
      	at com.liferay.portal.security.antisamy.internal.AntiSamySanitizerImpl.addPolicy(AntiSamySanitizerImpl.java:89)
      	at com.liferay.portal.security.antisamy.internal.AntiSamySanitizerPublisher.updated(AntiSamySanitizerPublisher.java:85)
      	at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.updated(ManagedServiceFactoryTracker.java:159)
      	at org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.provideConfiguration(ManagedServiceFactoryTracker.java:93)
      	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.provide(ConfigurationManager.java:1239)
      	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.run(ConfigurationManager.java:1183)
      	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138)
      	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: org.owasp.validator.html.PolicyException: org.xml.sax.SAXParseException; lineNumber: 25; columnNumber: 10; The string "--" is not permitted within comments.
      	at org.owasp.validator.html.Policy.getTopLevelElement(Policy.java:301)
      	at org.owasp.validator.html.Policy.getTopLevelElement(Policy.java:283)
      	at org.owasp.validator.html.Policy.getInstance(Policy.java:172)
      	at com.liferay.portal.security.antisamy.internal.AntiSamySanitizerImpl.addPolicy(AntiSamySanitizerImpl.java:84)
      	... 8 more
      Caused by: org.xml.sax.SAXParseException; lineNumber: 25; columnNumber: 10; The string "--" is not permitted within comments.
      	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
      	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      	at org.owasp.validator.html.Policy.getTopLevelElement(Policy.java:298)
      	... 11 more
      

      Full console log:
      https://testray.liferay.com/reports/production/logs/test-1-16/1597100633117/test-portal-testsuite-upstream(master)/469/functional-tomcat90-mysql57-jdk8/22/0/liferay-osgi-log.txt.gz

      Affect case:
      LocalFile.AntiSamy#AssertSpecificRulesWorksForModel

      Attachments

        Activity

          People

            marta.medio Marta Medio (Inactive)
            della.wang Della Wang (Inactive)
            Marta Elicegui Marta Elicegui
            Marta Medio Marta Medio (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              2 years, 17 weeks, 1 day ago

              Packages

                Version Package
                Master