Legacy Knowledge Base
Published Jul. 2, 2025

Staging publish fails after migration with an ORMException or StaleObjectStateException

Written By

Justin Mann

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

  • After migrating the Liferay DXP 7.3 environment, the publication process of publishing from the staging server to the live server fails due to an ORMException or a StaleObjectStateException.
  • The new staging environment database was setup by copying over the old staging environment database.
  • The new live environment database was setup by copying over the old staging environment database.
  • The following error occurs when publishing to live:
The publication process did not start due to validation errors.
Invocation failed due to com.liferay.exportimport.kernel.lar.PortletDataException
2022-04-12 23:15:08.899 ERROR [liferay/background_task-4][BackgroundTaskMessageListener:182] Unable to execute background task
com.liferay.portal.kernel.exception.PortalException: Invocation failed due to com.liferay.exportimport.kernel.lar.PortletDataException

 

Environment

  • Liferay DXP 7.3

 

Resolution

  • This exception usually happens when multiple threads (or even multiple servers) work with the same data, it is possible for one of them to attempt to update a 'stale' object and report a StaleObjectStateException.
  • This issue may be caused if the same database is used for both the new staging and production environments. Doing this may introduce a scenario where entities with matching UUIDs and GroupIds between the new staging and production environments would be encountered, resulting in the StaleObjectStateException.
  • To resolve this, create a clean database for the remote Live environment, instead of copying the database from the staging environment. Afterwards, configure Remote staging to publish to the Live site, and then run an initial publish from the Staging site to the Remote Live site. This will copy all of the data from the Staging site to the Remote Live site and should allow publishes to proceed without error.
Did this article resolve your issue ?

Legacy Knowledge Base