Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception thrown during nested pages migration when no space is defined #98

Open
aubincleme opened this issue Jun 8, 2023 · 3 comments

Comments

@aubincleme
Copy link
Contributor

aubincleme commented Jun 8, 2023

Note : I'm creating the issue in this project as I encountered the issue while going through the Confluence migration assistant, however so far, I'm not sure if the issue is really caused by the code in the assistant or by the code in the nested pages migrator application.

Steps to reproduce

  • Create a new instance of XWiki 14.10.10 ; configure it with enough memory for the import (I used -Xmx6g)
  • Install the confluence migrator ; activate the license
  • Take an export of the test instance we use for Confluence migrations on XWiki SAS Confluence account
  • Start a new migration profile ; perform the import as usual (I went directly to step 4 : XWiki import)
  • Skip step 5

Expected

Step 6 shows the interface that allows to run the nested pages migration of the imported pages

Actual

The assistant step shows the following error :

Stack trace

Failed to execute the [velocity] macro. Cause: [An Entity Reference name cannot be null or empty]. Click on this message for details.

org.xwiki.rendering.macro.MacroExecutionException: Failed to evaluate Velocity Macro for content [#set($ext = $services.extension.installed.getInstalledExtension("org.xwiki.contrib:application-nestedpagesmigrator-ui", "wiki:$xcontext.wiki"))
#if($ext.version.toString().startsWith("0.8"))
{{error}}
The Nested Spaces Migrator 0.8 is currently incompatible with the Confluence Migrator. You will need to downgrade the extension to 0.7.x.
{{/error}}
#else
#set ($discard = $xwiki.jsx.use('Confluence.Tools.NestedPagesMigration'))
#set ($discard = $xwiki.ssx.use('Confluence.Tools.NestedPagesMigration'))
#if (!$services.security.authorization.hasAccess('admin', $xcontext.userReference, $doc.documentReference.wikiReference))
  {{error}}
  You don't have the right to use this tool on this wiki. You need to be administrator.
  {{/error}}
#else
## Prepare the space to be migrated by the nested pages migrator (step 6).
## Basically the confluence space name configured at
## Confluence Migrator Level will be escaped according to XWiki SPACE reference syntax,
## For example, dots '.' on a space name will be replace by '\.'
#set ($confluenceSpace = $xwiki.getDocument($services.confluencemigrator.profile.activeProfile).getValue('space'))
#set ($xwikiSpace = $services.model.escape($confluenceSpace, "SPACE"))
##
## Both job.css and extension.css are needed because the ui-progress classes that we need to display
## a progress bar are in one of these 2 files depending on the XWiki version
#set ($discard = $xwiki.ssfx.use('uicomponents/job/job.css', true))
#set ($discard = $xwiki.ssfx.use('uicomponents/extension/extension.css', true))
#set ($discard = $xwiki.ssfx.use('uicomponents/logging/logging.css', true))
#set ($discard = $xwiki.linkx.use($services.webjars.url('org.xwiki.platform:xwiki-platform-tree-webjar', 'tree.min.css',
    {'evaluate': true}), {'type': 'text/css', 'rel': 'stylesheet'}))
{{html clean="false"}}
<!------------------------------------------
  Migration Action Template
  ------------------------------------------->
<script id="MigrationActionTemplate" type="text/html">
  <!-- ko foreach: ${escapetool.d}data.actions -->
  <li class="jstree-node" data-bind="
    visible: (!targetDocument.equals(sourceDocument) || getNumberOfChildren() > 0 || getNumberOfPreferences() > 0 || getNumberOfRights()> 0),
    css: {
      'jstree-closed': !displayChildren(),
      'jstree-open'  : displayChildren(),
      'jstree-leaf'  : getNumberOfChildren() == 0 && getNumberOfPreferences() == 0,
      'jstree-last'  : ${escapetool.d}index() == ${escapetool.d}parent.actions.length - 1
    }">
    ## Display the tree branch
    <i class="jstree-icon jstree-ocl" role="presentation" data-bind="click: toggleDisplayChildren"></i>
    ##  Display the checbox
    <input type="checkbox" data-bind="checked: enabled" />
    ## Display the 'all' link
    <a href="#" data-bind="visible: !enabled() && (getNumberOfChildren() > 0 || getNumberOfPreferences() > 0 || getNumberOfRights()> 0), click: enableWithChildren" >(all)</a>
    ## Display the document name
    <strong class="documentName" data-bind="text: getTargetName(), click: toggleDisplayChildren, css: { 'bg-danger': isTooLong() }"></strong>
    ## Display the target location
    [<span data-bind="text: serializedTargetDocument()" class="monospace"></span>]
    ## Display if the action is a change or not
    <em data-bind="visible: targetDocument.equals(sourceDocument)">(unchanged)</em>
    ## Display if a previous document will be deleted
    <strong data-bind="visible: deletePrevious">(duplicated document will be deleted)</strong>
    ## Display the exclude page button
    <button class="btn btn-default btn-xs" data-bind="click: ${escapetool.d}root.excludePage, disable: targetDocument.equals(sourceDocument)">exclude page</button>
    ## Display the exclude space button
    <button class="btn btn-default btn-xs" data-bind="click: ${escapetool.d}root.excludeSpace">exclude space</button>
    ## Display th button to change the parent of ht document
    <button class="btn btn-default btn-xs" data-bind="click: ${escapetool.d}root.setParent">set parent</button>
    ## Display the number of children
    (<span data-bind="text: getNumberOfChildren()"></span> children,
    ## Display the number of preferences
    <span data-bind="text: getNumberOfPreferences()"></span> preferences,
    ## Display the number of rights
    <span data-bind="text: getNumberOfRights()"></span> rights)
    ## Display the original location
    from <a target="_blank" class="monospace" data-bind="text: serializedSourceDocument(), attr: {href: getSourceLink()}"></a>
    ## Display all children
    <!-- ko if: displayChildren() -->
      ## Display preferences
      <!-- ko if: preferences.length > 0 -->
        <ul data-bind="foreach: preferences" class="jstree-children">
          <li class="text-warning jstree-node jstree-leaf">
            <i class="jstree-icon jstree-ocl" role="presentation"></i>
            <input type="checkbox" data-bind="checked: enabled"/> <strong>[Preferences] <span data-bind="text: property"></span> : <span data-bind="text: value"></span></strong> (coming from <a target="_blank" class="monospace" data-bind="text: getSerializedOrigin(), attr: {href: getOriginLink()}"></a>)
          </li>
        </ul>
      <!-- /ko -->
      ## Display rights
      <!-- ko if: rights.length > 0 -->
        <ul data-bind="foreach: rights" class="jstree-children">
          <li class="text-danger jstree-node jstree-leaf">
            <i class="jstree-icon jstree-ocl" role="presentation"></i>
            <input type="checkbox" data-bind="checked: enabled"/> <strong>[Right] <span data-bind="text: toString()"></span></strong> (coming from <a target="_blank" class="monospace" data-bind="text: getSerializedOrigin(), attr: {href: getOriginLink()}"></a>)
          </li>
        </ul>
      <!-- /ko -->
      ## Display children documents
      <ul data-bind="template: { name: 'MigrationActionTemplate', data: {'actions': children()} }" class="jstree-children"></ul>
    <!-- /ko -->
  </li>
  <!-- /ko -->
</script>
<!------------------------------------------
  Display Logs
  ------------------------------------------->
<script id="DisplayLogs" type="text/html">
  <h2 class="log-title">Logs: </h2>
  <ul class="log" data-bind="if: logs().length > 0">
    <!-- ko foreach: logs -->
    <li class="log-item" data-bind="css: getClass()">
      <div data-bind="text: message"></div>
      <!-- ko if: stackTrace -->
      <pre data-bind="text: stackTrace"></pre>
      <!--  /ko -->
    </li>
    <!-- /ko -->
  </ul>
</script>
<!------------------------------------------
  Display plan
  ------------------------------------------->
<script id="DisplayPlan" type="text/html">
  <h2>Plan</h2>
  <div class="migration-plan box">
    <div data-bind="if: isComputing()" id="planComputing">
      <p>The plan is being computed and it could take some time. Please wait...</p>
      <div class="ui-progress-background">
        <div class="ui-progress-bar green" data-bind="style: {width: progress() + '%'}"></div>
      </div>
    </div>
    <div class="box warningmessage" data-bind="visible: duplicates().length > 0">
      <p>The migration have detected some duplicated documents, that are probably the consequences of a failed attempt to run the migrator.<br />
      <p>If it's the first time you run the migrator, you might have a problem.</p>
      <p>Theses documents are:</p>
      <ul data-bind="foreach: {data: duplicates(), as: 'doc'}">
        <li data-bind="text: doc"></li>
      </ul>
      <p>If you are ok with it, just run the migrator and these documents will be overwritten.</p>
    </div>
     <div class="box errormessage" data-bind="visible: tooLongs().length > 0">
      <p>We have detected some pages that will have too long path after the migration (limit is #getLocalReferenceMaxLength()). You should rename them (or rename one of their parents) before computing a new plan.</p>
      <p>Theses pages are:</p>
      <ul data-bind="foreach: {data: tooLongs(), as: 'action'}">
        <li class="monospace"><a data-bind="attr: {href: action.getSourceLink()}" target="_blank"><span data-bind="text: action.serializedSourceDocument()"></span></a> -&gt; <span data-bind="text: action.serializedTargetDocument()"></span></li>
      </ul>
    </div>
    <ul data-bind="if: actions() && !isComputing() && !isPlanEmpty()" id="planTree" class="jstree jstree-xwiki jstree-xwiki-responsive jstree-container-ul">
      <!-- ko template: {name: 'MigrationActionTemplate', data: {'actions': actions() }} -->
      <!-- /ko -->
    </ul>
    <!-- ko if: !isComputing() && isPlanEmpty() -->
    <div class="box infomessage">
      <p>There is nothing to do!</p>
    </div>
    <!-- /ko -->
    <!-- ko template: {name: 'DisplayLogs', data: ${escapetool.d}root} -->
    <!-- /ko -->
  </div>
</Script>
<!------------------------------------------
  Display configuration
  ------------------------------------------->
<form class="xform">
  <div class="row">
  <div class="col-xs-12 col-md-6">
    <input type="hidden" id="includedSpaces" data-bind="value: configuration.includedSpaces" data-valuefromprofile="$!escapetool.xml($xwikiSpace)">
    <input type="hidden" id="excludedSpaces" data-bind="value: []">
  </div>
  <div class="col-xs-12 col-md-6">
    <p><button class="btn btn-default hidden" type="button" data-toggle="collapse" data-target="#advancedSettings" aria-expanded="false" aria-controls="advancedSettings">Advanced Settings</button></p>
    <dl id="advancedSettings" class="collapse well">
      <!-- Exclude hidden pages -->
      <dt><input type="checkbox" id="excludeHiddenPages" data-bind="checked: configuration.excludeHiddenPages"> <label for="excludeHiddenPages">Exclude hidden pages</label></dt>
      <dd><span class="xHint">Most of the hidden pages are technical content. Moving them can break applications.</span></dd>
      <!-- Exclude class pages -->
      <dt><input type="checkbox" id="excludeClassPages" data-bind="checked: configuration.excludeClassPages"> <label for="excludeClassPages">Exclude pages having a class</label></dt>
      <dd><span class="xHint">The pages are technical and moving them can break applications.</span></dd>
      <!-- Don't move children -->
      <dt><input type="checkbox" id="dontMoveChildren" data-bind="checked: configuration.dontMoveChildren"> <label for="dontMoveChildren">Do not move children</label></dt>
      <dd><span class="xHint">Only convert terminal pages to nested pages, without moving them under their parent.</span></dd>
      <!-- Add redirection -->
      <dt><input type="checkbox" id="addRedirection" data-bind="checked: configuration.addRedirection"> <label for="addRedirection">Add redirection</label></dt>
      <dd><span class="xHint">Add a redirection in the old location.</span></dd>
      <!-- Convert preferences -->
      <dt><input type="checkbox" id="convertPreferences" data-bind="checked: configuration.convertPreferences"> <label for="convertPreferences">Convert preferences</label></dt>
      <dd><span class="xHint">Make sure that the preferences applied on the page remain the same after the move, by dupplicating the preferences on the target document.</span></dd>
      <!-- Convert rights -->
      <dt><input type="checkbox" id="convertRights" data-bind="checked: configuration.convertRights"> <label for="convertRights">Convert rights (experimental)</label></dt>
      <dd><span class="xHint">Make sure that the rights applied on the page remain the same after the move <span class="text-danger">(Currently bugged)</span>.</span></dd>
      <!-- Excluded Object Classes -->
      <dt><label for="excludedObjectClasses" data-bind="click: toggleXClassList">Exclude classes</label></dt>
      <dd>
        <p class="xHint" data-bind="click: toggleXClassList">Exclude pages holding an object of one of the specified classes (separated by a coma ',').</p>
        <p><textarea id="excludedObjectClasses" data-bind="textInput: configuration.excludedObjectClasses, click: showXClassList" data-localReferenceMaxLength="#getLocalReferenceMaxLength()" data-xclasses="#foreach($class in $xwiki.classList)#if($foreach.count>1),#end${class}#end"></textarea></p>
        <div data-bind="visible: xclassListVisible">
          <a data-bind="click: hideXClassList" href="#">$services.icon.renderHTML('remove') Hide</a>
          <ul data-bind="foreach: {data: xclasses, as: 'xclass'}" style="list-style-type: none; padding: 0;">
            <li><label><input type="checkbox" data-bind="checked: xclass.selected"/> <span data-bind="text: xclass.name"</span></label></li>
          </ul>
        </div>
      </dd>
    </dl>
  </div>
  </div>
  <div class="clearfix">
    <h2>Actions</h2>
    <button class="btn btn-primary" data-bind="click: computePlan, disable: isComputing() || isPlanExecuting()">Compute plan</button>
    <button class="btn btn-primary" data-bind="disable: actions().length == 0 || isPlanExecuting() || tooLongs().length > 0, click: executePlan">Execute plan</button>
  </div>
</form>
<!------------------------------------------
  Display plan
  ------------------------------------------->
<div data-bind="if: isPlanRequested() && !isPlanExecuting()">
  ## We escape the dollar of the knockout variable '$root' because $root also exists in velocity
  <!-- ko template: {name: 'DisplayPlan', data: ${escapetool.d}root} -->
  <!-- /ko -->
</div>
<!------------------------------------------
  Execute Plan
  ------------------------------------------->
<!-- ko if: isPlanExecuting() && !success()-->
<div class="box" id="planExecuting">
  <p>The plan is being executed and it could take some time. Please wait...</p>
  <div class="ui-progress-background">
    <div class="ui-progress-bar green" data-bind="style: {width: progress() + '%'}"></div>
  </div>
  <!-- ko template: {name: 'DisplayLogs', data: ${escapetool.d}root} -->
  <!-- /ko -->
</div>
<!-- /ko -->
<!------------------------------------------
  Display breakages
  ------------------------------------------->
<!-- ko if: isBreakageListRequested-->
<h2>Breakages</h2>
<div class="box">
  <div data-bind="if: isComputing">
    <p>The list of broken pages is being computed, please wait...</p>
    <div class="ui-progress-background">
      <div class="ui-progress-bar green" data-bind="style: {width: progress() + '%'}"></div>
    </div>
    <!-- ko template: {name: 'DisplayLogs', data: ${escapetool.d}root} -->
    <!-- /ko -->
  </div>
  <div data-bind="ifnot: isComputing">
    <p>If you don't migrate your pages, <strong data-bind="text: breakageList().size()"></strong> documents will lose their current parent.</p>
    <ul data-bind="foreach: breakageList">
      <li>Page <span data-bind="text: document" class="monospace box infomessage" ></span> will lose its current parent <span data-bind="text: actualParent" class="monospace box infomessage"></span> because its location parent is <span data-bind="text: locationParent" class="monospace box infomessage"></span>.</li>
    </ul>
  </div>
</div>
<!-- /ko -->
<!------------------------------------------
  End message
  ------------------------------------------->
<!-- ko if: success() -->
  <div class="box successmessage" id="planExecuted">
  The plan have been executed!
  </div>
  <!-- ko template: {name: 'DisplayLogs', data: ${escapetool.d}root} -->
  <!-- /ko -->
<!-- /ko -->
{{/html}}
#end
#end]
 at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:135)
 at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:51)
 at org.xwiki.rendering.macro.script.AbstractScriptMacro.evaluateBlock(AbstractScriptMacro.java:279)
 at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:182)
 at org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:58)
 at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:309)
 at org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183)
 at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:88)
 at org.xwiki.display.internal.DocumentContentAsyncExecutor.executeInCurrentExecutionContext(DocumentContentAsyncExecutor.java:395)
 at org.xwiki.display.internal.DocumentContentAsyncExecutor.execute(DocumentContentAsyncExecutor.java:268)
 at org.xwiki.display.internal.DocumentContentAsyncRenderer.execute(DocumentContentAsyncRenderer.java:112)
 at org.xwiki.rendering.async.internal.block.AbstractBlockAsyncRenderer.render(AbstractBlockAsyncRenderer.java:157)
 at org.xwiki.rendering.async.internal.block.AbstractBlockAsyncRenderer.render(AbstractBlockAsyncRenderer.java:54)
 at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:290)
 at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267)
 at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.execute(DefaultBlockAsyncRendererExecutor.java:125)
 at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:67)
 at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:43)
 at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:96)
 at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:39)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:245)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.applySheet(SheetDocumentDisplayer.java:225)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.maybeDisplayWithSheet(SheetDocumentDisplayer.java:180)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:111)
 at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:52)
 at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:68)
 at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:42)
 at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1355)
 at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1492)
 at com.xpn.xwiki.doc.XWikiDocument.displayDocument(XWikiDocument.java:1441)
 at com.xpn.xwiki.doc.XWikiDocument.displayDocument(XWikiDocument.java:1410)
 at com.xpn.xwiki.api.Document.displayDocument(Document.java:786)
 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
 at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:571)
 at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:554)
 at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221)
 at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
 at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:704)
 at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:75)
 at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:242)
 at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
 at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
 at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:190)
 at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
 at org.xwiki.velocity.internal.directive.TryCatchDirective.render(TryCatchDirective.java:86)
 at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304)
 at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
 at org.apache.velocity.Template.merge(Template.java:358)
 at org.apache.velocity.Template.merge(Template.java:262)
 at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:280)
 at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:321)
 at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:95)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:222)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.renderVelocity(TemplateAsyncRenderer.java:177)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:138)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:54)
 at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.lambda$syncRender$0(DefaultAsyncRendererExecutor.java:284)
 at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98)
 at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:284)
 at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267)
 at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.render(DefaultBlockAsyncRendererExecutor.java:154)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:843)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:805)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:792)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:747)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:739)
 at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:79)
 at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:73)
 at org.xwiki.template.script.TemplateScriptService.render(TemplateScriptService.java:54)
 at jdk.internal.reflect.GeneratedMethodAccessor159.invoke(Unknown Source)
 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
 at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:571)
 at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:554)
 at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221)
 at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
 at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:492)
 at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
 at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:218)
 at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:331)
 at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:261)
 at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304)
 at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
 at org.apache.velocity.Template.merge(Template.java:358)
 at org.apache.velocity.Template.merge(Template.java:262)
 at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:280)
 at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:321)
 at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:95)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:222)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.renderVelocity(TemplateAsyncRenderer.java:177)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:138)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:54)
 at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.lambda$syncRender$0(DefaultAsyncRendererExecutor.java:284)
 at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98)
 at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:284)
 at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267)
 at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.render(DefaultBlockAsyncRendererExecutor.java:154)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:843)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:805)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:792)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:747)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderNoException(InternalTemplateManager.java:739)
 at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:79)
 at com.xpn.xwiki.internal.template.DefaultTemplateManager.renderNoException(DefaultTemplateManager.java:73)
 at org.xwiki.template.script.TemplateScriptService.render(TemplateScriptService.java:54)
 at jdk.internal.reflect.GeneratedMethodAccessor159.invoke(Unknown Source)
 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
 at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:571)
 at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:554)
 at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221)
 at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
 at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:492)
 at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
 at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:218)
 at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:331)
 at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:261)
 at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304)
 at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
 at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:171)
 at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
 at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
 at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:190)
 at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
 at org.apache.velocity.Template.merge(Template.java:358)
 at org.apache.velocity.Template.merge(Template.java:262)
 at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:280)
 at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:321)
 at com.xpn.xwiki.internal.template.VelocityTemplateEvaluator.evaluateContent(VelocityTemplateEvaluator.java:95)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.evaluateContent(TemplateAsyncRenderer.java:222)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.renderVelocity(TemplateAsyncRenderer.java:177)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:138)
 at com.xpn.xwiki.internal.template.TemplateAsyncRenderer.render(TemplateAsyncRenderer.java:54)
 at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.lambda$syncRender$0(DefaultAsyncRendererExecutor.java:284)
 at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98)
 at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.syncRender(DefaultAsyncRendererExecutor.java:284)
 at org.xwiki.rendering.async.internal.DefaultAsyncRendererExecutor.render(DefaultAsyncRendererExecutor.java:267)
 at org.xwiki.rendering.async.internal.block.DefaultBlockAsyncRendererExecutor.render(DefaultBlockAsyncRendererExecutor.java:154)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:843)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:805)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:785)
 at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:771)
 at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:91)
 at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:85)
 at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2553)
 at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:180)
 at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:613)
 at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:301)
 at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:114)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
 at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1419)
 at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
 at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1624)
 at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
 at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
 at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
 at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
 at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
 at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
 at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
 at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
 at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
 at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
 at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
 at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
 at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
 at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
 at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
 at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
 at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210)
 at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
 at org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:164)
 at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
 at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1594)
 at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:506)
 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
 at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578)
 at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
 at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
 at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1571)
 at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
 at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1378)
 at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
 at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:463)
 at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1544)
 at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
 at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1300)
 at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
 at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:192)
 at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:51)
 at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
 at org.eclipse.jetty.server.Server.handle(Server.java:562)
 at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:418)
 at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:675)
 at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:410)
 at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
 at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:319)
 at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
 at org.eclipse.jetty.io.SocketChannelEndPoint$1.run(SocketChannelEndPoint.java:101)
 at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:412)
 at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:381)
 at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:268)
 at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(AdaptiveExecutionStrategy.java:138)
 at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:407)
 at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:894)
 at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1038)
 at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with namespace [xwiki:Confluence.Migrator.Code.MigratorSheet]
 at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:289)
 at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:321)
 at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:127)
 ... 209 more
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'escape' in  class org.xwiki.model.script.ModelScriptService threw exception java.lang.IllegalArgumentException: An Entity Reference name cannot be null or empty at xwiki:Confluence.Migrator.Code.MigratorSheet[line 19, column 37]
 at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:308)
 at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:235)
 at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
 at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:704)
 at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:75)
 at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:242)
 at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
 at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
 at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:190)
 at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
 at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
 at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:190)
 at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
 at org.apache.velocity.Template.merge(Template.java:358)
 at org.apache.velocity.Template.merge(Template.java:262)
 at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:280)
 ... 211 more
Caused by: java.lang.IllegalArgumentException: An Entity Reference name cannot be null or empty
 at org.xwiki.model.reference.EntityReference.setName(EntityReference.java:212)
 at org.xwiki.model.reference.EntityReference.<init>(EntityReference.java:185)
 at org.xwiki.model.reference.EntityReference.<init>(EntityReference.java:142)
 at org.xwiki.model.script.ModelScriptService.escape(ModelScriptService.java:953)
 at jdk.internal.reflect.GeneratedMethodAccessor441.invoke(Unknown Source)
 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.base/java.lang.reflect.Method.invoke(Method.java:566)
 at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:571)
 at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:554)
 at org.xwiki.velocity.introspection.MethodArgumentsUberspector$ConvertingVelMethod.invoke(MethodArgumentsUberspector.java:306)
 at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221)
 ... 225 more

Environnement

  • XWiki 14.10.10 coming from the standard Jetty package, running on OpenJDK 11.0.12
  • Confluence migrator in version 1.0.14
  • Nested pages migrator application in version 0.7.6, installed automatically when installing the Confluence migrator
@aubincleme aubincleme changed the title NullPointerException Step 6 : Nested pages migration is not working on 14.10.10 Jun 8, 2023
@aubincleme
Copy link
Contributor Author

Marking as a blocker bug as it prevents the migrator to function properly on the recommended version of XWiki.

@aubincleme aubincleme changed the title Step 6 : Nested pages migration is not working on 14.10.10 Exception thrown during nested pages migration when no space is defined Jun 8, 2023
@aubincleme
Copy link
Contributor Author

Looking at the code, I believe the issue comes from the fact that I did not provide a space key when creating the migration profile.

@aubincleme
Copy link
Contributor Author

Yes, I confirm that when taking time to provide the space key, then import wizard goes much better. I'll remove the bug label and mark the issue as an improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant