Can I use per-instance portal-[companyId].properties files in my enviroment?

Issue

  • You would like to have a per-instance properties file after adding -Dcompany-id-properties=true in setenv or system-ext properties.
  • While infrequent, a StackOverflowError can be reproduced and potentially flooding the log file:
    ...
    at com.liferay.portal.kernel.service.CompanyLocalServiceUtil.getCompany(CompanyLocalServiceUtil.java:412) ~[portal-kernel.jar:?]
    at com.liferay.portal.util.PropsUtil._getConfiguration(PropsUtil.java:245) ~[portal-impl.jar:?]
    at com.liferay.portal.util.PropsUtil.get(PropsUtil.java:104) ~[portal-impl.jar:?]
    at com.liferay.portal.util.PropsImpl.get(PropsImpl.java:34) ~[portal-impl.jar:?]
    at com.liferay.portal.kernel.util.PropsUtil.get(PropsUtil.java:31) ~[portal-kernel.jar:?]
    ...
    at com.liferay.portal.kernel.service.CompanyLocalServiceUtil.getCompany(CompanyLocalServiceUtil.java:412) ~[portal-kernel.jar:?]
    ...

Environment

  • Liferay DXP 7.3, 7.4, Quarterly Releases

Resolution

  • Although it may work in some cases, enabling -Dcompany-id-properties=true is not supported:  "As of DXP 7.3, the per-virtual instance portal properties file feature has been removed. DXP no longer applies per-instance properties from files of the format portal-[companyId].properties to instances matching the company IDs."
  • Instance properties should be moved to the portal-ext.properties file:
    1. Remove the -Dcompany-id-properties=true property from the Java options in the setenv.sh file.
    2. Consolidate all portal properties into a single portal-ext.properties file. If you are using separate properties files for different virtual instances (e.g., portal-<id>.properties), merge their contents into the main portal-ext.properties file. A custom prefix or suffix can be added to the moved instance properties, if needed.
    3. Restart the Liferay server after making these changes.

Additional Information

 

这篇文章有帮助吗?
0 人中有 0 人觉得有帮助