Support Article

Activity in Service-REST fails with NullPointerException



A custom activity in a Service-REST fails with a NullPointerException. Issue is similar one detailed in PDN article:

User is requesting port to Pega 7.1.8.

Error Messages

  Caused by: java.lang.NullPointerException
    at com.pegarules.generated.activity.ra_action_authenticateofflineuser_daaaa6ae1929d7e2e886952183f55220.step1_circum0(

    at com.pegarules.generated.activity.ra_action_authenticateofflineuser_daaaa6ae1929d7e2e886952183f55220.perform(

    at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(
    at com.pega.pegarules.session.internal.mgmt.authentication.AuthenticationUtil.runActivity(


Steps to Reproduce

  1. Create a Service Package and Service-REST rule.
  2. Create an Authentication Service with an authentication activity.
  3. Set the Authentication Service in the Service Package.
  4. In the authentication activity, have the code to read the HTTP servlet request as below:
    1. ​@java("((javax.servlet.http.HttpServletRequest)tools.getRequestor().getRequestorPage().getObject(\"pxHTTPServletRequest\")).getHeader(\"SMUSER\")")
  5. Test the connector.

Root Cause

Servlet request object is not available in custom authentication activity.


Apply HFix-30358.


Published November 8, 2016 - Updated November 18, 2016

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.