Legacy Knowledge Base
Published Jul. 2, 2025

PortletException thrown when form field rule is inconsistent

Written By

Kanchan Bisht

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

  • An exception is thrown when some form field rule is empty or incorrect and the user tries to save the form.

    Steps to reproduce:

    1. Add a new form with three text fields: A, B, C
    2. Add a new rule for this form using the fields: if A equals B, show C
    3. Save the form.
    4. Edit the form and delete field A.
    5. The recently created rule is now inconsistent: A does not exist anymore.
    6. Publish the form.

    Observed Behavior: the below exceptions can be observed on the console.

    03-Jun-2021 06:58:51.558 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [621,752] milliseconds
    2021-06-03 07:11:46.466 ERROR [http-nio-8080-exec-10][PortletServlet:119] javax.portlet.PortletException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to [Lcom.liferay.dynamic.data.mapping.form.builder.internal.converter.model.DDMFormRuleCondition;
    javax.portlet.PortletException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to [Lcom.liferay.dynamic.data.mapping.form.builder.internal.converter.model.DDMFormRuleCondition;
            at com.liferay.portal.kernel.portlet.bridges.mvc.BaseTransactionalMVCActionCommand.processAction(BaseTransactionalMVCActionCommand.java:59)
            at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.callActionMethod(MVCPortlet.java:378)
            at com.liferay.portal.kernel.portlet.LiferayPortlet.processAction(LiferayPortlet.java:88)
            at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.processAction(MVCPortlet.java:260)
            at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:77)

    Expected Behavior: a more specific error message should be shown in the UI: "ERROR: There are invalid rule expressions."

Environment

  • Liferay DXP 7.2

Resolution

  • It's a known issue and is fixed by LPS-118102
  • Since the code has been considerably changed, this might be fixed in the upcoming fixpack. However, If the hotfix is required for this issue, please create a support ticket requesting hotfix by attaching patch details.
  • Installing Fix Packs and Hotfixes on Liferay DXP will guide to install this hotfix in the respective environment.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base