Issue
- After upgrade from DXP 7.3 to 7.4 the following error is displayed:
2023-10-24 17:28:16.854 ERROR [SCR Component Actor][ROOT:47] bundle com.liferay.portal.properties.swapper:5.0.24 (179)[com.liferay.portal.properties.swapper.internal.SwapDefaultGuestGroupLogoPortalInstanceLifecycleListener(11661)] : The activate method has thrown an exception
java.lang.IllegalStateException: Unable to get default company ID
at com.liferay.portal.kernel.instance.PortalInstancePool.getDefaultCompanyId(PortalInstancePool.java:40) ~[portal-kernel.jar:?]
at com.liferay.portal.util.PortalInstances.getDefaultCompanyId(PortalInstances.java:226) ~[portal-impl.jar:?]
at com.liferay.portal.util.PortalImpl.getDefaultCompanyId(PortalImpl.java:2356) ~[portal-impl.jar:?]
at com.liferay.portal.properties.swapper.internal.SwapDefaultGuestGroupLogoPortalInstanceLifecycleListener.activate(SwapDefaultGuestGroupLogoPortalInstanceLifecycleListener.java:82) ~[?:?]
[...]
Environment
- Liferay DXP 7.4
Resolution
- The main problem is that value of the property
company.default.web.id=
in portal-ext.properties has been set to companyId instead of webId. - In order to fix this problem, this property must be set with the Web Id value found in Control Panel > Configuration > Virtual Instances.
Additional Information
- See also this Liferay blog post: Unable to get default company ID Exceptions
- Unable to get default company ID error encountering after upgrade
- Adding a Virtual Instance