Uploaded image for project: 'Task Manager Application'
  1. Task Manager Application
  2. TASKMAN-62

Failed to execute velocity on a task page when you are logged out

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.5
    • 2.4.1
    • IE11, Chrome 49

    Description

      1. Login with Admin on XE 7.4.1 and create a new task.
      2. Fill all the details needed and save it.
      3. Logout.

      Actual result:

      • You will see in the right panel (where are supposed to be displayed the tasks recently created when you are logged in) this error:
      Failed to execute the [velocity] macro. Click on this message for details.
      
      org.xwiki.rendering.macro.MacroExecutionException: Failed to evaluate Velocity Macro for content [  #panelheader($services.localization.render('taskmanager.panel.paneltitle'))
        #set($query = "from doc.object(TaskManager.TaskManagerClass) as document where doc.fullName <> 'TaskManager.TaskManagerTemplate' and document.assignee=:currentUser order by document.duedate asc")
        #set($results = $services.query.xwql("$query").bindValue("currentUser", $services.model.serialize($xcontext.userReference,'compactwiki')).setLimit(5).execute())
        #foreach($result in $results)
          #set($object = $xwiki.getDocument($result).getObject('TaskManager.TaskManagerClass'))
          * $services.icon.render('accept') **[[$object.getProperty('name').value>>$result]]**
          (% class="text-muted small" %)$services.localization.render('taskmanager.panel.untildate') $datetool.format('HH:mm dd/MMM/yyyy',$object.getProperty('duedate').value)
        #end
        #if($results.size() == 0)
          (% class="pull-left"%)$services.localization.render('taskmanager.panel.noactivetasks')
        #else
          (% class="pull-right"%)[[$services.localization.render('taskmanager.panel.fulltasklist')>>TaskManager.WebHome]]
        #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:286)
      	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:269)
      	at org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183)
      	at org.xwiki.panels.internal.PanelWikiUIExtension$1.call(PanelWikiUIExtension.java:175)
      	at org.xwiki.panels.internal.PanelWikiUIExtension$1.call(PanelWikiUIExtension.java:169)
      	at com.xpn.xwiki.internal.template.SUExecutor.call(SUExecutor.java:91)
      	at org.xwiki.panels.internal.PanelWikiUIExtension.execute(PanelWikiUIExtension.java:168)
      	at sun.reflect.GeneratedMethodAccessor341.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      	at java.lang.reflect.Method.invoke(Unknown Source)
      	...
      Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id [xwiki:TaskManager.TaskManagerPanel]
      	at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:224)
      	at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:198)
      	at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:124)
      	... 138 more
      Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'execute' in  class org.xwiki.query.internal.ScriptQuery threw exception org.xwiki.query.QueryException: Exception while executing query. Query statement = [ select doc.fullName from XWikiDocument as doc , BaseObject as document , com.xpn.xwiki.objects.LargeStringProperty as document_assignee1, com.xpn.xwiki.objects.DateProperty as document_duedate2 where ( doc.fullName <> 'TaskManager.TaskManagerTemplate' and document_assignee1.value = :currentUser ) and doc.fullName=document.name and document.className='TaskManager.TaskManagerClass' and document_assignee1.id.id=document.id and document_assignee1.id.name='assignee' and document_duedate2.id.id=document.id and document_duedate2.id.name='duedate' order by document_duedate2.value asc ] at 122:xwiki:TaskManager.TaskManagerPanel[line 3, column 151]
      	... 162 more
      

      Attachments

        Issue Links

          Activity

            People

              msmeria Manuel Smeria
              ihrehorciuc Irina Hrehorciuc
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: