Uploaded image for project: 'Portals Bridges'
  1. Portals Bridges
  2. PB-84

CCE in PortletWindowUtils.getPortletWindowId

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.0
    • None
    • common
    • None
    • Mac OS, Wicket Portlets, OpenPortal Portlet Container

    Description

      I'm trying to get wicket portlet support working over OpenPortal. I've hacked together implementations of ServletContextProvider and PortletResourceURLFactory - just required exposing WicketFilter from the Application to get the necessary data. I can deploy a portlet, but...

      I'm getting this exception.

      java.lang.ClassCastException: java.lang.Double
      at org.apache.portals.bridges.util.PortletWindowUtils.getPortletWindowId(PortletWindowUtils.java:45)

      Looking at the code, this seems like a clear bug: The method casts to String here:
      (String)session.getAttribute(PORTLET_WINDOW_ID);

      and if null fills in the value with an instance of Double. If it's going to put a Double there, it should probably not expect a String - this exception will occur any time this method is called twice for a PortletSession, it will throw the CCE the second time it is called.

      Since the value is not used, probably simply changing it to
      Object portletWindowId = session.getAttribute(PORTLET_WINDOW_ID);

      would fix it.

      Attachments

        1. portals-bridges-common-1.0.4.jar
          21 kB
          Ate Douma
        2. utils.patch
          5 kB
          Antony Stubbs

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kablosna Tim Boudreau
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: