1. Pluto
  2. PLUTO-270

Dot in context path or portlet name causes NPE in Pluto driver


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0-alpha1, 1.1.0-beta1, 1.1.0-beta2, 1.1-286-COMPATIBILITY
    • Fix Version/s: 1.1.0
    • Component/s: portal driver
    • Labels:
    • Environment:
      All environments


      When there is a dot (.) in the context path of a portet, the Pluto driver throws an NPE that points to a logging call in PortletModeAnchorTag.isPortletModeAllowed() (line 161) because the window parameter is null. The cause of this null parameter is because ResourceConfig.getPortletWindow() cannot find the portlet application because the call to getContextFromPortletId() returns an incorrect context.

      The solution appears to be to change the indexOf() call in getContextFromPortletId() to lastIndexOf() (line 239). This assumes that the portlet name (portlet-name in portlet.xml) also does not have a dot in its name. The 'dot check' in the portlet name should be done at deploy time (via ant, maven or admin portlet). In addition the getPortletNameFromPortletId() method should also change the indexOf() call to lastIndexOf() on line 252.

      In other words, ResourceConfig (and other places, I'm sure) assume the portlet Id is the context path and portlet name appended together with a dot.

      We should also do a null check prior to the logging call in PortletModeAnchorTag.isPortletModeAllowed().

      This is my best guess as to the cause of the problem at this moment. I will try to apply the 'lastIndexOf' fixes and the null check in PortletModeAnchorTag when I get a chance, but anyone else is welcome to do the same.



          • Assignee:
            Craig Doremus
            Craig Doremus
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: