legacy-knowledge-base
公開されました Sep. 10, 2025

ClassCastException When Adding Web Content in Batch via Headless API

written-by

Madhusudan Sharma

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

Issue

  • When attempting to add web content in batch using the headless API endpoint /o/headless-delivery/v1.0/sites/{siteId}/structured-contents/batch, a ClassCastException occurs. The error resembles the following:
ERROR [default-2][BatchEngineImportTaskExecutorImpl:155] Unable to update batch engine import task
java.lang.RuntimeException: java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class com.liferay.headless.delivery.dto.v1_0.ContentFieldValue (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; com.liferay.headless.delivery.dto.v1_0.ContentFieldValue is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @6ee031b1)
...Caused by: java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class com.liferay.headless.delivery.dto.v1_0.ContentFieldValue (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; com.liferay.headless.delivery.dto.v1_0.ContentFieldValue is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @6ee031b1)
  • However, if the individual endpoint /o/headless-delivery/v1.0/sites/{siteId}/structured-contents is hit, it works without any errors.

Environment

  • DXP 2024.Q3.12

Resolution

  • This is a known bug that has been addressed by LPD-48903

Additional Information

  • If a hotfix is required, please create a support ticket requesting the hotfix by attaching the patch details.
  • The following articles will guide you to install the Fixpack/Hotfix in your environment: 
did-this-article-resolve-your-issue

legacy-knowledge-base