Uploaded image for project: 'Jetspeed 2 (Retired)'
  1. Jetspeed 2 (Retired)
  2. JS2-254

NullPointerException in PortletSession.getPortletContext()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-dev/cvs
    • None
    • Container
    • None
    • WindowsXP SP2, JBoss 4.0.1SP1, HSQL

    Description

      From a JSR168 portlet's render method, calling:
      request.getPortletSession().getPortletContext();

      generates the following exception:
      java.lang.NullPointerException
      at org.apache.pluto.core.impl.PortletSessionImpl.getInternalPortletContext(PortletSessionImpl.java:242)
      at org.apache.pluto.core.impl.PortletSessionImpl.getPortletContext(PortletSessionImpl.java:199)
      ... portlet code ...
      at javax.portlet.GenericPortlet.render(GenericPortlet.java:175)
      at org.apache.jetspeed.factory.JetspeedPortletInstance.render(JetspeedPortletInstance.java:96)
      at org.apache.jetspeed.container.JetspeedContainerServlet.doGet(JetspeedContainerServlet.java:224)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

      This was confirmed by Ate Douma on the jetspeed-users list. His explanation is:
      ...[I] already have traced down the cause.

      The bad news:
      This isn't something new but a missing implementation of a Pluto object model interface, namely:
      PortletEntity.getPortletApplicationEntity() (which returns null in Jetspeed).

      After scanning the Pluto container sources, this is the only place this method is invoked at all (in the container that is) and we must have simply overlooked it.
      What Pluto actually does (in PortletSessionImpl.getInternalPortletContext) is trying to get to the current PortletApplicationDefinition:
      portletEntity.getPortletApplicationEntity().getPortletApplicationDefinition()
      This could just as well have been written as:
      portletEntity.getPortletDefinition().getPortletApplicationDefinition()
      which is implemented in Jetspeed.

      Attachments

        Activity

          People

            taylor David Sean Taylor
            dpankros David Pankros
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: