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

SA-30158

Summary



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

https://pdn.pega.com/support-articles/nullpointerexception-while-reading-header-rest-service.

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(
          ra_action_authenticateofflineuser_daaaa6ae1929d7e2e886952183f55220.java:290)
    at com.pegarules.generated.activity.ra_action_authenticateofflineuser_daaaa6ae1929d7e2e886952183f55220.perform(
          ra_action_authenticateofflineuser_daaaa6ae1929d7e2e886952183f55220.java:69)
    at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3500)
    at com.pega.pegarules.session.internal.mgmt.authentication.AuthenticationUtil.runActivity(AuthenticationUtil.java:208)

 

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.

Resolution



Apply HFix-30358.

 

Suggest Edit

Published November 18, 2016 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

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

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