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

Liferay deploy process can't handle comments in web.xml

    Details

      Description

      When you try to deploy a hook (but probably just every Liferay plugin that contains a web.xml, e.g.: portlet) that has a web.xml that contains a section in comments (<!-- -->) the deployment will fail with the following message:

      14:03:59,418 ERROR [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:210] com.liferay.portal.kernel.deploy.auto.AutoDeployException: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : The value following "version" in the XML declaration must be a quoted string. Nested exception: The value following "version" in the XML declaration must be a quoted string.
      com.liferay.portal.kernel.deploy.auto.AutoDeployException: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : The value following "version" in the XML declaration must be a quoted string. Nested exception: The value following "version" in the XML declaration must be a quoted string.
      	at com.liferay.portal.tools.deploy.BaseDeployer.autoDeploy(BaseDeployer.java:201)
      	at com.liferay.portal.deploy.auto.WebAutoDeployListener.deploy(WebAutoDeployListener.java:51)
      	at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.processFile(AutoDeployDir.java:193)
      	at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.scanDirectory(AutoDeployDir.java:235)
      	at com.liferay.portal.kernel.deploy.auto.AutoDeployScanner.run(AutoDeployScanner.java:54)
      Caused by: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : The value following "version" in the XML declaration must be a quoted string. Nested exception: The value following "version" in the XML declaration must be a quoted string.
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:399)
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:378)
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:409)
      	at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:155)
      	at com.liferay.portal.tools.WebXMLBuilder.organizeWebXML(WebXMLBuilder.java:60)
      	at com.liferay.portal.tools.deploy.BaseDeployer.updateWebXml(BaseDeployer.java:2078)
      	at com.liferay.portal.tools.deploy.BaseDeployer.deployDirectory(BaseDeployer.java:576)
      	at com.liferay.portal.tools.deploy.BaseDeployer.deployFile(BaseDeployer.java:957)
      	at com.liferay.portal.tools.deploy.BaseDeployer.deployFile(BaseDeployer.java:889)
      	at com.liferay.portal.tools.deploy.BaseDeployer.autoDeploy(BaseDeployer.java:198)
      	... 4 more
      Caused by: org.dom4j.DocumentException: Error on line 1 of document  : The value following "version" in the XML declaration must be a quoted string. Nested exception: The value following "version" in the XML declaration must be a quoted string.
      	at org.dom4j.io.SAXReader.read(SAXReader.java:482)
      	at org.dom4j.io.SAXReader.read(SAXReader.java:365)
      	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:396)
      	... 13 more
      

      A similar issue description was found on Stackoverflow, http://stackoverflow.com/questions/11883813/xml-parsing-error-in-liferay-6-1-1, and the workaround they propose there, completely removing the commented section, seems to work.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  7 years, 21 weeks, 2 days ago

                  Packages

                  Version Package
                  6.1.2 CE GA3
                  6.1.30 EE GA3
                  6.2.0 CE M2