Uploaded image for project: 'GateIn Portal'
  1. GateIn Portal
  2. GTNPORTAL-1541

Concurreny problem - NullPointerException in BreadcumbsPortlet during performance test



      Sometimes during performance test, I am seeing NPE exception in server log, thrown from UIBreadcumbsPortlet. Exception stacktrace is:

      2010-10-06 09:11:15,589 ERROR [org.exoplatform.webui.application.portlet.PortletApplicationController] (http- Error while rendering the porlet
      at org.exoplatform.portal.webui.component.UIBreadcumbsPortlet.loadSelectedPath(UIBreadcumbsPortlet.java:69)
      at org.exoplatform.portal.webui.component.UIBreadcumbsPortlet.renderChildren(UIBreadcumbsPortlet.java:89)
      at org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle.processRender(UIApplicationLifecycle.java:73)
      at org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle.processRender(UIApplicationLifecycle.java:31)
      at org.exoplatform.webui.core.UIComponent.processRender(UIComponent.java:144)
      at org.exoplatform.webui.core.UIPortletApplication.processRender(UIPortletApplication.java:146)
      at org.exoplatform.webui.application.portlet.PortletApplication.render(PortletApplication.java:253)
      at org.exoplatform.webui.application.portlet.PortletApplicationController.render(PortletApplicationController.java:110)
      at org.gatein.pc.portlet.impl.jsr168.PortletContainerImpl$Invoker.doFilter(PortletContainerImpl.java:569)

      Whole test log is attached in related issue JBEPP-459 for completeness. It is not occuring in every performance test but only sometimes, so concurreny issue came to my mind first.

      I did more investigation and I founded that the cause of problem is in thread-unsafe call of method "getUIComponentEventConfig" on class "org.exoplatform.webui.config.Component".
      Problem can be seen if client1 calls this method and eventsMap is null -> eventsMap is going to initialize during this call.
      But when client2 calls this method before initialization of map by client1 is finished, then problem can happen because eventsMap is not fully initialized for client2 -> client2 can't find ChangePageNode event -> listener UIPageActionListener.ChangePageNodeActionListener is not called for client2 -> UIPortal of client2 has unitialized variables selectedNode and selectedPath -> NullPointerException is thrown for client2 during rendering of BreadcumbsPortlet, because UIPortal.selectedPath is null.

      Steps to reproduce (with usage of Eclispe IDE):

      • Add breakpoint to class org.exoplatform.webui.config.Component to line 184 (after call of eventMap = new HashMap<String, Event>() )
      • Open browser1 and go to localhost:8080/portal/public/classic . Client will be stopped on breakpoint
      • Open browser2 and go to localhost:8080/portal/public/classic . This client is not seeing ChangePageNode event and so NPE is thrown for him in UIBreadcumbsPortlet.

      Note: Method getUIComponentEventConfig is called many times during single HTTP request. So is it possible to fix this issue by other way that full initialization of this method? Because it can have bad impact on performance. I wonder if it's possible to initialize eventsMap in constructor of Component class (only suggestion)

        Gliffy Diagrams


            Issue Links



                • Assignee:
                  hoang_to Minh Hoang TO
                  mposolda Marek Posolda
                • Votes:
                  0 Vote for this issue
                  0 Start watching this issue


                  • Created:

                    Time Tracking

                    Original Estimate - 6 hours
                    Remaining Estimate - 6 hours
                    Time Spent - Not Specified
                    Not Specified