Caused by: com.liferay.portal.kernel.xml.DocumentException: Error on line 12 of document : The reference to entity "S" must end with the ';' delimiter. at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:409) ~[portal-impl.jar:?] at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:383) ~[portal-impl.jar:?] at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:420) ~[portal-impl.jar:?] at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:161) ~[portal-kernel.jar:?] at com.liferay.journal.internal.upgrade.v1_1_0.DocumentLibraryTypeContentUpgradeProcess._convertContent(DocumentLibraryTypeContentUpgradeProcess.java:49) ~[?:?] at com.liferay.journal.internal.upgrade.v1_1_0.DocumentLibraryTypeContentUpgradeProcess._updateContent(DocumentLibraryTypeContentUpgradeProcess.java:91) ~[?:?] at com.liferay.journal.internal.upgrade.v1_1_0.DocumentLibraryTypeContentUpgradeProcess.doUpgrade(DocumentLibraryTypeContentUpgradeProcess.java:45) ~[?:?] at com.liferay.portal.kernel.upgrade.UpgradeProcess.lambda$upgrade$0(UpgradeProcess.java:130) ~[portal-kernel.jar:?] at com.liferay.portal.db.partition.DBPartitionUtil.forEachCompanyId(DBPartitionUtil.java:126) ~[portal-impl.jar:?] at com.liferay.portal.dao.db.BaseDB.process(BaseDB.java:337) ~[portal-impl.jar:?] at com.liferay.portal.kernel.dao.db.BaseDBProcess.process(BaseDBProcess.java:387) ~[portal-kernel.jar:?] at com.liferay.portal.kernel.upgrade.UpgradeProcess.upgrade(UpgradeProcess.java:115) ~[portal-kernel.jar:?] ...
This error is thrown when an XML document has errors, such as a tag is not closed or mistyped, etc.
The mentioned upgrade step is querying Web Contents (Journal Articles) which are contains a Document Library field.
The error indicates that you have one or multiple Web Contents with a Document Library field where the content XML of the Web Content has issues
Environment
Liferay DXP 7.4
Resolution
With the following query, you can check the rows:
select content, id_ from JournalArticle where content like '%type=\"document_library\"%';
You can run the attached groovy script to validate the listed rows
if(invalidArticleIds.size() >0) { logger.info("The articles with the following IDs have issues in their content XML ("+ invalidArticleIds.size() +" in total):"); for(long articleId : invalidArticleIds) { logger.info((String)articleId); } } else { logger.info("All of the specified articles' content XMLs are valid."); } } catch (Exception e) { logger.info("Failed to read the articles from the database "+ e.printStackTrace()); } finally { DataAccess.cleanUp(con, ps, rs); } logger.info("Script is finished.");
Once you have the faulty ones, you should make sure that the XML values are fixed