Legacy Knowledge Base
Published Sep. 10, 2025

CAPTCHA_TEXT Not Set In The Portlet Session

Written By

Apsara Raheja

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

  • While validating the captcha in the custom module, the following exception shows:

    "CAPTCHA text is null. User null may be trying to circumvent the CAPTCHA."

  • Steps to reproduce:
    1. Deploy my-test-captcha-1.0.0.jar. This is located in the /build/lib.

    2. Add it to a page, as a widget. It's under Sample, or you can search for it.

    3. Input an email and the Captcha text.

    Actual Result: CAPTCHA Verification will fail.
    Expected Result: CAPTCHA Verification is successful.
    Note: This only happens with a custom captcha portlet, the captcha components from the portal (Example: "forgot password" page) are working as expected.

Environment

  • Liferay DXP 7.4

Resolution

  • Previously, there were 2 methods named as serveImage in CaptchaUtil:

    # method 1:
    serveImage(ResourceRequest resourceRequest, ResourceResponse resourceResponse)

    # method 2:
    serveImage(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)

  • However, this LPS-181665: Remove method references in CaptchaUtil removed method 1, and only method 2 is available now, therefore all usages of method 1 should be adapted to invoke method 2 only.
  • This has been addressed in LPS-196214.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base