Uploaded image for project: 'Magnolia Personalization'
  1. Magnolia Personalization
  2. MGNLPN-290

ItemNotFoundException with VariantAwareTemplatingFunctions and NPE with VariantAwareTemplateTypeHelper

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: 1.3
    • Component/s: None
    • Labels:
      None
    • Magnolia Release:
      5.4.9

      Description

      With latest personalization 1.3-SNAPSHOT open the page variant plenty of ItemNotFoundException and NPE will occure in log.

      2016-06-17 10:05:39,188 ERROR ization.templating.VariantAwareTemplatingFunctions: Can't unwrap variant.
      javax.jcr.ItemNotFoundException: Root node doesn't have a parent
      	at org.apache.jackrabbit.core.NodeImpl$6.perform(NodeImpl.java:1754)
      	at org.apache.jackrabbit.core.NodeImpl$6.perform(NodeImpl.java:1747)
      	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
      	at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
      	at org.apache.jackrabbit.core.NodeImpl.getParent(NodeImpl.java:1747)
      	at info.magnolia.jcr.wrapper.DelegateNodeWrapper.getParent(DelegateNodeWrapper.java:494)
      	at info.magnolia.jcr.decoration.ContentDecoratorNodeWrapper.getParent(ContentDecoratorNodeWrapper.java:121)
      	at info.magnolia.jcr.wrapper.DelegateNodeWrapper.getParent(DelegateNodeWrapper.java:494)
      	at info.magnolia.jcr.decoration.ContentDecoratorNodeWrapper.getParent(ContentDecoratorNodeWrapper.java:121)
      	at info.magnolia.jcr.wrapper.DelegateNodeWrapper.getParent(DelegateNodeWrapper.java:494)
      	at info.magnolia.jcr.decoration.ContentDecoratorNodeWrapper.getParent(ContentDecoratorNodeWrapper.java:121)
      	at info.magnolia.jcr.wrapper.DelegateNodeWrapper.getParent(DelegateNodeWrapper.java:494)
      	at info.magnolia.jcr.decoration.ContentDecoratorNodeWrapper.getParent(ContentDecoratorNodeWrapper.java:121)
      	at info.magnolia.jcr.wrapper.DelegateNodeWrapper.getParent(DelegateNodeWrapper.java:494)
      	at info.magnolia.jcr.decoration.ContentDecoratorNodeWrapper.getParent(ContentDecoratorNodeWrapper.java:121)
      	at info.magnolia.personalization.decoration.PersonalizationNodeWrapper.getParent(PersonalizationNodeWrapper.java:158)
      	at info.magnolia.personalization.templating.VariantAwareTemplatingFunctions.getVariantOriginNode(VariantAwareTemplatingFunctions.java:71)
      	at info.magnolia.personalization.templating.VariantAwareTemplatingFunctions.linkPrefix(VariantAwareTemplatingFunctions.java:60)
      
      FreeMarker template error:
      An error has occurred when reading existing sub-variable "username"; see cause exception! The type of the containing value was: extended_hash+string (info.magnolia.demo.travel.model.NavigationAreaModel wrapped into f.e.b.StringModel)
      ....
      Caused by: java.lang.NullPointerException
      	at info.magnolia.rendering.template.type.TemplateTypeHelper.getContentListByTemplateIds(TemplateTypeHelper.java:227)
      	at info.magnolia.personalization.templating.VariantAwareTemplateTypeHelper.getContentListByTemplateIds(VariantAwareTemplateTypeHelper.java:54)
      	at info.magnolia.templating.functions.TemplatingFunctions.contentListByTemplateIds(TemplatingFunctions.java:1271)
      	at info.magnolia.demo.travel.user.DefaultUserLinksResolver.findPage(DefaultUserLinksResolver.java:105)
      	at info.magnolia.demo.travel.user.DefaultUserLinksResolver.useForCurrentPage(DefaultUserLinksResolver.java:75)
      	at info.magnolia.demo.travel.model.NavigationAreaModel.getUserLinksResolver(NavigationAreaModel.java:174)
      	at info.magnolia.demo.travel.model.NavigationAreaModel.getUsername(NavigationAreaModel.java:136)
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mdivilek Milan Divilek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: