legacy-knowledge-base
公開されました Jul. 2, 2025

移行後にORMExceptionまたはStaleObjectStateExceptionが発生し、Staging Publishに失敗する。

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

learn-legacy-article-disclaimer-text

問題

  • Liferay DXP 7.3環境を移行した後、ステージングサーバーからライブサーバーへの公開処理がORMExceptionまたはStaleObjectStateExceptionで失敗します。
  • 新しいステージング環境のデータベースは、古いステージング環境のデータベースをコピーオーバーしてセットアップされました。
  • 新しいライブ環境のデータベースは、古いステージング環境のデータベースをコピーオーバーすることでセットアップされました。
  • 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

環境

  • Liferay DXP 7.3

解像度

  • この例外は通常、複数のスレッド(あるいは複数のサーバー)が同じデータを扱うときに発生し、そのうちの1つが「古い」オブジェクトを更新しようとしてStaleObjectStateExceptionを報告する可能性があります。
  • この問題は、新しいステージング環境と本番環境の両方で同じデータベースを使用している場合に発生する可能性があります。 このようにすると、新しいステージング環境と本番環境でUUIDとGroupIdsが一致するエンティティが発生し、StaleObjectStateExceptionが発生するというシナリオが発生することがあります。
  • これを解決するには、ステージング環境からデータベースをコピーするのではなく、リモートLive環境用にクリーンなデータベースを作成します。 その後、LiveサイトにパブリッシュするようにRemote stagingを設定し、StagingサイトからRemote Liveサイトへの初期パブリッシュを実行します。 これにより、ステージングサイトからリモートライブサイトにすべてのデータがコピーされ、パブリッシュがエラーなく進行するはずです。
did-this-article-resolve-your-issue

legacy-knowledge-base