Issue
- When attempting to add web content in batch using the headless API endpoint
/o/headless-delivery/v1.0/sites/{siteId}/structured-contents/batch, aClassCastExceptionoccurs. 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: