title: Why am I receiving a `Request must not be null` exception when calling getSessionAttribute()?
body: <p>Why am I receiving the following error from my code?</p>
  
  <blockquote>
    <p>Error 500: Request processing failed; nested exception is java.lang.IllegalArgumentException: Request must not be null</p>
  </blockquote>
  
  <p><strong>Code Snippet</strong></p>
  
  <pre><code>protected void buildPdfDocument(Map modelo, Document document, PdfWriter pdfWriter, HttpServletRequest request, HttpServletResponse response) throws IOException
  {
  
      // The problem is here to pass HttpServletRequest to ActionRequest or PortletRequest
      ActionRequest aRequest = (ActionRequest) request.getAttribute("javax.portlet.request");
  
      // I need to validate user's session
      Cliente cliente = (Cliente) PortletUtils.getSessionAttribute(aRequest, AtokConstante.CLIENTE_SESION,PortletSession.APPLICATION_SCOPE);
  }
  </code></pre>