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

NPE when refreshing the page on Administration after canceling an invitation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 8.4.6, 11.10.3, 12.0
    • None
    • None
    • Windows 10 Pro 64 bit, Chrome 79, using a local instance XWiki 12.0 on PostgreSQL 12
    • Unknown

    Description

      STEPS TO REPRODUCE

      1. Login as Admin
      2. Create an user on Main Wiki (e.g. U1)
      3. Create a subwiki with User Scope 'Both global and local users are available in the wiki'
      4. On subwiki, go to Administer Wiki > Users & Rights > Users
      5. Under 'Add or invite users to wiki', select the user from Main Wiki (U1)
      6. Click 'Invite'
      7. Under 'Candidates', click 'Cancel Invitation'
      8. Refresh the page (F5) and confirm form re-submission on the browser (if the case)

      EXPECTED RESULTS

      The page is refreshed properly, no errors are displayed.

      ACTUAL RESULTS

      A NPE error is displayed on the page:

      Failed to execute the [velocity] macro. Cause: [null]. Click on this message for details.

      Partial stacktrace:

      Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with namespace [subwikiadmin:XWiki.AdminSheet]
      	at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:289)
      	at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:316)
      	at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:131)
      	... 120 more
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getCandidacy' in  class org.xwiki.wiki.user.script.WikiUserManagerScriptService threw exception java.lang.NullPointerException at subwikiadmin:XWiki.AdminSheet[line 112, column 46]
      	at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:306)
      	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:233)
      	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:369)
      	at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:701)
      	at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:72)
      	at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:240)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:144)
      	at org.apache.velocity.runtime.parser.node.ASTElseIfStatement.render(ASTElseIfStatement.java:104)
      	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:191)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:144)
      	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:172)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:144)
      	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:172)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:423)
      	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:281)
      	... 122 more
      Caused by: java.lang.NullPointerException
      	at org.xwiki.wiki.user.internal.DefaultWikiUserManager.readCandidacyFromObject(DefaultWikiUserManager.java:328)
      	at org.xwiki.wiki.user.internal.DefaultWikiUserManager.getCandidacy(DefaultWikiUserManager.java:425)
      	at org.xwiki.wiki.user.script.WikiUserManagerScriptService.getCandidacy(WikiUserManagerScriptService.java:365)
      	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:565)
      	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:548)
      	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:219)
      	... 137 more

      Full stacktrace here: https://up1.xwikisas.com/#Lo1YwW2HJilmJtO_f4gReQ

      Reproduced also on XWiki 11.10.3 and XWiki 8.4.6.

      Attachments

        Activity

          People

            Unassigned Unassigned
            iandriuta Ilie Andriuta
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: