Legacy Knowledge Base
Published Jul. 2, 2025

Moving an asset category lead to bigint out of range error

Written By

Zalán Szakolci

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

  • We have tens of thousands of categories, and we perform frequent changes in the structure, moving categories in the category tree.
  • I experience bigint out of range error when trying to move a category.

Environment

  • Liferay DXP 7.1
  • Liferay DXP 7.2

Resolution

  • You need to rebuild the category tree by performing the following steps:
    1. Go to Control Panel -> Server Administration -> Script
    2. Select "Groovy" in the drop down for Language
    3. Paste this code, and click Execute
    import com.liferay.portlet.asset.service.AssetCategoryLocalServiceUtil
    AssetCategoryLocalServiceUtil.rebuildTree(<gid>,true)
    In the AssetCategoryLocalServiceUtil class, rebuildTree requires the groupId and a boolean to force the change. <gid> is the groupId of the affected Site, and you'll need "true" to force the rebuild.
    So if you want to fix the Site's Categories, you can find out its groupId in the database or from the UI (siteId) and change the script appropriately.
    4. Restart Liferay or go back to Server Administration -> Resource and click "Clear the database cache."

 

 

Did this article resolve your issue ?

Legacy Knowledge Base