Uploaded image for project: '[Read Only] - Hippo Repository'
  1. [Read Only] - Hippo Repository
  2. REPO-921

Faceted navigation configuration with incorrect hippo:docbase generates NPE that is hard to correct

    XMLWordPrintable

Details

    Description

      Faceted navigation configuration requires a hippo:docbase property that indicates the scope. This hippo:docbase should contain a UUID. However, unexperienced Hippo developers sometimes try to use an absolute path instead of a UUID. When such a hippo:docbase is saved, the faceted navigation engine throws a NullPointerException. Worse, it is then impossible to edit the broken faceted navigation configuration node in the console again and correct the mistake.

      Steps to reproduce:

      1. start the archetype
      2. in the console, create the following node with the following properties:

      /content/documents/gettingstarted/news/newsfacets

      • hippo:docbase = /content/documents/gettingstarted/news
      • hippofacnav:facets = gettingstarted:date

      Note that the hippo:docbase property erroneously contains an absolute path instead of a UUID.

      4. click 'Save changes'

      Expected behavior: an error is logged and the user can correct his mistake by editing the 'newsfacets' node in the console

      Actual behavior: the stacktrace below is logged and the 'Save session' dialog stays open, whether you click 'Save' or 'Cancel'. Reloading the console (i.e. hit 'F5') shows an NPE error on a white page. Removing the 'path' parameter from the URL and reloading the console shows the UI again, but without being able to navigate the tree. After logging out and in again you can navigate the tree, but once you navigate to /content/documents/gettingstarted/news the console logs the NPE again and start behaving weird (e.g. the 'news' node stays selected when selecting another node). This makes it very hard to restore the repository to a sane state again (you would have to stop it, enable RMI, and then connect over RMI with the JCR shell application to fix the node; I haven't tried this).

      [INFO] [talledLocalContainer] java.lang.NullPointerException
      [INFO] [talledLocalContainer] at org.hippoecm.repository.FacetedNavigationEngineImpl.getFilterBitSet(FacetedNavigationEngineImpl.java:833)
      [INFO] [talledLocalContainer] at org.hippoecm.repository.FacetedNavigationEngineImpl.doView(FacetedNavigationEngineImpl.java:399)
      [INFO] [talledLocalContainer] at org.hippoecm.repository.FacetedNavigationEngineImpl.view(FacetedNavigationEngineImpl.java:352)
      [INFO] [talledLocalContainer] at org.hippoecm.repository.FacetedNavigationEngineImpl.view(FacetedNavigationEngineImpl.java:94)
      [INFO] [talledLocalContainer] at org.hippoecm.repository.jackrabbit.facetnavigation.FacetNavigationProvider.doPopulate(FacetNavigationProvider.java:255)
      [INFO] [talledLocalContainer] at org.hippoecm.repository.jackrabbit.facetnavigation.FacetNavigationProvider.populate(FacetNavigationProvider.java:90)
      [INFO] [talledLocalContainer] at org.hippoecm.repository.jackrabbit.HippoLocalItemStateManager.getItemState(HippoLocalItemStateManager.java:388)
      [INFO] [talledLocalContainer] at org.apache.jackrabbit.core.state.SessionItemStateManager.getItemState(SessionItemStateManager.java:161)
      [INFO] [talledLocalContainer] at org.apache.jackrabbit.core.ItemManager.getItemData(ItemManager.java:382)
      [INFO] [talledLocalContainer] at org.apache.jackrabbit.core.ItemManager.getNode(ItemManager.java:669)
      [INFO] [talledLocalContainer] at org.apache.jackrabbit.core.ItemManager.getNode(ItemManager.java:647)
      [INFO] [talledLocalContainer] at org.apache.jackrabbit.core.LazyItemIterator.prefetchNext(LazyItemIterator.java:120)
      [INFO] [talledLocalContainer] at org.apache.jackrabbit.core.LazyItemIterator.next(LazyItemIterator.java:257)
      [INFO] [talledLocalContainer] at org.hippoecm.repository.decorating.RangeIteratorDecorator.next(RangeIteratorDecorator.java:112)
      [INFO] [talledLocalContainer] at org.hippoecm.repository.decorating.NodeIteratorDecorator.nextNode(NodeIteratorDecorator.java:54)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.observation.NodeState.<init>(NodeState.java:154)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.observation.JcrObservationManager.addEventListener(JcrObservationManager.java:103)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.model.event.JcrEventListener.start(JcrEventListener.java:73)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.model.JcrNodeModel.startObservation(JcrNodeModel.java:142)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.model.event.ObservableRegistry.addObserver(ObservableRegistry.java:128)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.model.event.ObservableRegistry$1.onServiceAdded(ObservableRegistry.java:111)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.model.event.ObservableRegistry$1.onServiceAdded(ObservableRegistry.java:106)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.service.ServiceTracker.addService(ServiceTracker.java:42)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.plugin.impl.PluginManager.internalRegisterService(PluginManager.java:276)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.plugin.impl.PluginManager.registerService(PluginManager.java:147)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.plugin.impl.PluginContext.registerService(PluginContext.java:211)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.service.render.AbstractRenderService.updateModel(AbstractRenderService.java:296)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.service.render.AbstractRenderService$1.onEvent(AbstractRenderService.java:160)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.model.event.ObservableRegistry$ObservationContext.notifyObservers(ObservableRegistry.java:75)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.model.ModelReference.setModel(ModelReference.java:104)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.service.render.AbstractRenderService.setDefaultModel(AbstractRenderService.java:283)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.plugins.console.browser.BrowserPlugin.onSelect(BrowserPlugin.java:148)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.plugins.console.browser.BrowserPlugin$BrowserTree.onNodeLinkClicked(BrowserPlugin.java:229)
      [INFO] [talledLocalContainer] at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree$9.onClick(DefaultAbstractTree.java:555)
      [INFO] [talledLocalContainer] at org.apache.wicket.extensions.markup.html.tree.DefaultAbstractTree$6.onClick(DefaultAbstractTree.java:484)
      [INFO] [talledLocalContainer] at org.apache.wicket.ajax.markup.html.AjaxLink$1.onEvent(AjaxLink.java:68)
      [INFO] [talledLocalContainer] at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
      [INFO] [talledLocalContainer] at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:312)
      [INFO] [talledLocalContainer] at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:157)
      [INFO] [talledLocalContainer] at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.PluginRequestCycleProcessor.processEvents(PluginRequestCycleProcessor.java:39)
      [INFO] [talledLocalContainer] at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1279)
      [INFO] [talledLocalContainer] at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
      [INFO] [talledLocalContainer] at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
      [INFO] [talledLocalContainer] at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
      [INFO] [talledLocalContainer] at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
      [INFO] [talledLocalContainer] at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
      [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      [INFO] [talledLocalContainer] at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:370)
      [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      [INFO] [talledLocalContainer] at org.hippoecm.frontend.plugins.login.ConcurrentLoginFilter.doFilter(ConcurrentLoginFilter.java:54)
      [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      [INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      [INFO] [talledLocalContainer] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      [INFO] [talledLocalContainer] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:615)
      [INFO] [talledLocalContainer] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      [INFO] [talledLocalContainer] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      [INFO] [talledLocalContainer] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
      [INFO] [talledLocalContainer] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
      [INFO] [talledLocalContainer] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      [INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:744)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mdenburger Mathijs den Burger (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: