There are 2 comments.
 
 
XWiki Platform / cid:jira-generated-image-avatar-4f61ddd6-68c0-4b2b-8473-6d00ce2e5739 XWIKI-24019 Open

XWiki.SchedulerJobClass: Job execution context user is not used

 
View issue   ยท   Add comment
 

2 comments

 
cid:jira-generated-image-avatar-f947119b-6799-4802-aeb0-18dc1ad24bd8 Thomas Mortagne on 19/Feb/26 16:23
 

I just tested the following:

  • use the standard jetty+hsqldb 17.10.2 with provided user "Admin"
  • create a scheduler page with
  • context user: "XWiki.Toto"
  • script:
    services.logging.getLogger("scheduler.test").error("${xcontext.getUserReference()}")
    services.logging.getLogger("scheduler.test").error("${xcontext.getAuthorReference()}")
    
  • scheduler the scheduler
  • trigger the scheduler

I get the following in the log:

2026-02-19 16:18:43,671 [DefaultQuartzScheduler_Worker-2] ERROR s.test                         - xwiki:XWiki.Tyty 
2026-02-19 16:18:43,672 [DefaultQuartzScheduler_Worker-2] ERROR s.test                         - xwiki:XWiki.Admin 

Suggesting that context *user* is the one indicated in the scheduler configuration. The context *author* is the one who wrote the script, as expected.

 
cid:jira-generated-image-avatar-f947119b-6799-4802-aeb0-18dc1ad24bd8 Thomas Mortagne on 19/Feb/26 16:23
 
I just tested the following:

* use the standard jetty+hsqldb 17.10.2 with provided user "Admin"
* create a scheduler page with
  * context user: "XWiki.Toto"
  * script:
{code}
services.logging.getLogger("scheduler.test").error("${xcontext.getUserReference()}")
services.logging.getLogger("scheduler.test").error("${xcontext.getAuthorReference()}")
{code}
* scheduler the scheduler
* trigger the scheduler

I get the following in the log:

{noformat}
2026-02-19 16:18:43,671 [DefaultQuartzScheduler_Worker-2] ERROR s.test                     - xwiki:XWiki.Tyty
2026-02-19 16:18:43,672 [DefaultQuartzScheduler_Worker-2] ERROR s.test                     - xwiki:XWiki.Admin
{noformat}

Suggesting that context *
* user* * is the one indicated in the scheduler configuration. The context * * author* * is the one who wrote the script, as expected.