Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

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 18, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us