Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-7515

'getIncludedPages' in class com.xpn.xwiki.api.Document threw java.lang.NullPointerException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.5-milestone-1
    • Component/s: Old Core
    • Labels:
      None
    • Environment:
      XWiki 3.3 / Tomcat6 / MySQL / WindowsXP
    • keywords:
      getIncludedPages
    • Tests:
      Unit
    • Difficulty:
      Trivial
    • Similar issues:

      Description

      On some pages i got an exception in the document info panel when editing a page and also on the document information tab of the page i got this error:

      org.xwiki.rendering.macro.MacroExecutionException: Failed to evaluate Velocity Macro for content [$xwiki.ssx.use('Panels.DocumentInformation')##
      #set ($pages = $tdoc.includedPages)
      #largepanelheader($msg.get('panels.documentInformation.title'))
      #if ($tdoc.language == '' && $xwiki.isMultiLingual())
      ; html<label for="xwikidoclanguageinput2">$msg.get('panels.documentInformation.defaultLanguage')</label>/html
      : html<input type="text" id="xwikidoclanguageinput2" name="defaultLanguage" value="$!tdoc.defaultLanguage" size="30"/>/html
      #end
      ##--------------------------------------------------------------------------

        1. Display wiki syntax combo box if there's more than one configured syntax.
          ##--------------------------------------------------------------------------
          $xwiki.jsx.use($paneldoc.fullName)##
          #if ($xwiki.getConfiguredSyntaxes().size() > 1)
          ; html<label for="xwikidocsyntaxinput2">$msg.get('panels.documentInformation.syntax')</label>/html
          : html<select name="syntaxId" id="xwikidocsyntaxinput2">
          <option value="xwiki/1.0"#if ($tdoc.getSyntax().toIdString().equalsIgnoreCase('xwiki/1.0')) selected="selected"#end>XWiki 1.0</option>
          #set ($configuredSyntaxes = $xwiki.getConfiguredSyntaxes())
          ##
        2. Starting with XE 2.3 the $syntaxFactory binding has been removed and the new $services binding added.
        3. To make sure this Panel application still work with versions less than 2.3 we verify the availability of bindings.
          #set ($availableParserSyntaxes = $services.rendering.getAvailableParserSyntaxes())
          #if (!$availableParserSyntaxes)
          #set ($availableParserSyntaxes = $syntaxFactory.getAvailableSyntaxes())
          #end
          ##
          #foreach ($syntax in $availableParserSyntaxes)
          #if ($configuredSyntaxes.contains($syntax.toIdString()) && !$syntax.toIdString().equalsIgnoreCase('xwiki/1.0'))
          <option value="$syntax.toIdString()"#if($tdoc.getSyntax().toIdString().equalsIgnoreCase($syntax.toIdString())) selected="selected"#end>$syntax.toString()</option>
          #end
          #end
          </select>/html
          #end
          ##--------------------------------------------------------------------------
          #if($pages.size() != 0)
          ; $msg.get('panels.documentInformation.includesCount', [$pages.size()])
          #foreach ($page in $pages)
          : [[$page>>$page]] [[[[image:icon:page_white_edit||alt="$msg.get('panels.documentInformation.editIncluded', [$page])"]]>>path:$xwiki.getURL($page, 'edit')]]
          #end
          #end
          #panelfooter()]
          at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:131)
          at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:50)
          at org.xwiki.rendering.macro.script.AbstractScriptMacro.evaluateBlock(AbstractScriptMacro.java:302)
          at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:198)
          at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:59)
          at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transformOnce(MacroTransformation.java:187)
          at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:132)
          at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:83)
          at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:248)
          at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:124)
          at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:54)
          at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:80)
          at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:38)
          at com.xpn.xwiki.internal.sheet.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:113)
          at com.xpn.xwiki.internal.sheet.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:57)
          at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:67)
          at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:41)
          at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:918)
          at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:884)
          at com.xpn.xwiki.objects.classes.TextAreaClass.displayView(TextAreaClass.java:235)
          at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:2810)
          at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:2771)
          at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:2720)
          at com.xpn.xwiki.api.Document.display(Document.java:1248)
          at sun.reflect.GeneratedMethodAccessor326.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
          at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
          at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
          at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
          at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
          at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
          at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
          at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
          at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
          at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
          at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
          at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:420)
          at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
          at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87)
          at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
          at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:186)
          at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:152)
          at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:117)
          at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1813)
          at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1750)
          at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:839)
          at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
          at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
          at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
          at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
          at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
          at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216)
          at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311)
          at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230)
          at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
          at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
          at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
          at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
          at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
          at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
          at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
          at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:186)
          at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:152)
          at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:117)
          at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1813)
          at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:154)
          at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:239)
          at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:116)
          at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
          at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
          at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
          at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:128)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:144)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:217)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
          at java.lang.Thread.run(Unknown Source)
          Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [xwiki:MySpace.MyDoc]
          at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:195)
          at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:152)
          at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:124)
          ... 112 more
          Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getIncludedPages' in class com.xpn.xwiki.api.Document threw exception java.lang.NullPointerException at xwiki:MySpace.MyDoc[line 2, column 22]
          at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:223)
          at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280)
          at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567)
          at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71)
          at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142)
          at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342)
          at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:186)
          ... 114 more
          Caused by: java.lang.NullPointerException
          at com.xpn.xwiki.doc.XWikiDocument.getIncludedPages(XWikiDocument.java:4795)
          at com.xpn.xwiki.api.Document.getIncludedPages(Document.java:1310)
          at sun.reflect.GeneratedMethodAccessor556.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.apache.velocity.runtime.parser.node.PropertyExecutor.execute(PropertyExecutor.java:142)
          at org.apache.velocity.util.introspection.UberspectImpl$VelGetterImpl.invoke(UberspectImpl.java:539)
          at org.apache.velocity.runtime.parser.node.ASTIdentifier.execute(ASTIdentifier.java:198)
          ... 120 more

        Attachments

          Activity

            People

            • Assignee:
              mflorea Marius Dumitru Florea
              Reporter:
              bernhard_h Bernhard Hopf
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: