Legacy Knowledge Base
Published Jul. 2, 2025

Java NPEs in the Console When Refreshing the CAPTCHA Image

Written By

Justin Choi

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

This article documents a known issue where refreshing the CAPTCHA image causes a Java NullPointerException (NPE) to be triggered. Please note that the CAPTCHA image will still be refreshed.

Steps to Reproduce

  1. Start the Liferay Digital Enterprise 7.0 platform.
  2. Click the Sign In link at the top.
  3. Click the Create Account button.
  4. Click the Refresh button next to the CAPTCHA image (usually a set of four random numbers).

At this point, the NPE appears in the console log despite no loss of functionality:

        java.lang.NullPointerException
        at com.jhlabs.image.ShadowFilter.imageComplete(ShadowFilter.java)
        at sun.awt.image.OffScreenImageSource.produce(OffScreenImageSource.java:189)
        at sun.awt.image.OffScreenImageSource.addConsumer(OffScreenImageSource.java:66)
        at sun.awt.image.OffScreenImageSource.startProduction(OffScreenImageSource.java:80)
        at java.awt.image.FilteredImageSource.startProduction(FilteredImageSource.java:183)
        at sun.awt.image.ImageRepresentation.startProduction(ImageRepresentation.java:732)
        at sun.awt.image.ImageRepresentation.drawToBufImage(ImageRepresentation.java:807)
        at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:1021)
        at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:186)
        at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3318)
        at nl.captcha.util.ImageUtil.applyFilter(Unknown Source)
        at nl.captcha.gimpy.DropShadowGimpyRenderer.gimp(Unknown Source)
        at nl.captcha.Captcha$Builder.gimp(Unknown Source)
        at com.liferay.captcha.simplecaptcha.SimpleCaptchaImpl.getSimpleCaptcha(SimpleCaptchaImpl.java:221)
        at com.liferay.captcha.simplecaptcha.SimpleCaptchaImpl.serveImage(SimpleCaptchaImpl.java:160)
        at com.liferay.captcha.util.CaptchaUtil.serveImage(CaptchaUtil.java:92)
        at com.liferay.login.web.internal.portlet.action.CaptchaMVCResourceCommand.serveResource(CaptchaMVCResourceCommand.java:46)
        at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.callResourceMethod(MVCPortlet.java:442)
        at com.liferay.portal.kernel.portlet.LiferayPortlet.serveResource(LiferayPortlet.java:140)
        at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.serveResource(MVCPortlet.java:342)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:122)
        at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:85)
        at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:116)
        at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:71)
        at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:108)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration.service(EndpointRegistration.java:153)
        at org.eclipse.equinox.http.servlet.internal.servlet.ResponseStateHandler.processRequest(ResponseStateHandler.java:62)
        at org.eclipse.equinox.http.servlet.internal.context.DispatchTargets.doDispatch(DispatchTargets.java:117)
        at org.eclipse.equinox.http.servlet.internal.servlet.RequestDispatcherAdaptor.forward(RequestDispatcherAdaptor.java:40)
        at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:528)
        at com.liferay.portlet.InvokerPortletImpl.invokeResource(InvokerPortletImpl.java:631)
        at com.liferay.portlet.InvokerPortletImpl.serveResource(InvokerPortletImpl.java:468)
        at com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.serveResource(MonitoringInvokerPortlet.java:303)
        at com.liferay.portlet.PortletContainerImpl._serveResource(PortletContainerImpl.java:839)
        at com.liferay.portlet.PortletContainerImpl.serveResource(PortletContainerImpl.java:176)
        at com.liferay.portlet.SecurityPortletContainerWrapper.serveResource(SecurityPortletContainerWrapper.java:165)
        at com.liferay.portlet.RestrictPortletContainerWrapper.serveResource(RestrictPortletContainerWrapper.java:173)
        at com.liferay.portal.kernel.portlet.PortletContainerUtil.serveResource(PortletContainerUtil.java:169)
        at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:303)
        at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:159)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
        at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:170)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
        at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:606)
        at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:583)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
        at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
        at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
        at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93) ...

Truncated for space

The cause of this known issue is the DropShadowGimpyRenderer CAPTCHA engine when using Java JDK 8.

Resolution

Status: Fixed

Update to Liferay DXP 7.0 Service Pack 7 (Fix Pack FP-40) or higher.

Additional Information

See LPS-65331 for more information and ultimate resolution. For customers who wish to receive this fix in the form of a hotfix, please open a ticket and include this LPS in the ticket.

The issue is also reproducible on Liferay Portal 6.2 that is running on Java JDK 8. If the Liferay Portal is running on JDK 7, the issue is not reproducible.

Did this article resolve your issue ?

Legacy Knowledge Base