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:
- Remove the
-Dcompany-id-properties=true
property from the Java options in thesetenv.sh
file. - 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. - Restart the Liferay server after making these changes.
- Remove the
Additional Information