Legacy Knowledge Base
Published Sep. 10, 2025

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

Written By

Daniel Carrillo Broeder

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

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

 

Did this article resolve your issue ?

Legacy Knowledge Base