There are 2 updates, 2 comments.
 
 
XWiki Platform / cid:jira-generated-image-avatar-c722c5bc-f067-4c24-995f-40e546900321 XWIKI-25802 Open

ClassNotFoundException when upgrading an extension that changes the displayer type of a wiki macro to a new type

 
View issue   ยท   Add comment
 

2 updates

 
cid:jira-generated-image-avatar-33dd0e05-6433-4072-9dec-1ce03afdccc7 Changes by Thomas Mortagne on 19/Nov/26 14:26
 
Summary: ClassNotFoundException when upgrading an extension that changes the displayer type of a page wiki macro to a new type
Component: Extension - XAR
 
 

2 comments

 
cid:jira-generated-image-avatar-33dd0e05-6433-4072-9dec-1ce03afdccc7 Thomas Mortagne on 19/Nov/26 14:26
 

I think what happens is that the wiki macro page is saved (and the macro registered), before the classloader is reloaded (which is done at the end of the extension job).

Not an easy fix. A common idea is to grab all the events produced during an extension job and release them at the end. But, aside from being potentially expensive in terms of memory, it also does not make much sense for various events (like *ing events which would not be able to modify the document about to be saved).

So that means delaying only some specific events. Fortunately document event don't implement Begin/EndEvent so it should technically be doable (delaying EndEvent would cause a huge mess to the ObservationContext).

 
cid:jira-generated-image-avatar-33dd0e05-6433-4072-9dec-1ce03afdccc7 Thomas Mortagne on 19/Nov/26 14:26
 
I think what happens is that the wiki macro page is saved (and the macro registered), before the classloader is reloaded (which is done at the end of the extension job).

Not an easy fix. A common idea is to grab all the events produced during an extension job and release them at the end. But, aside from being potentially expensive in terms of memory, it also does not make much sense for various events (like *ing events which would not be able to modify the document about to be saved).

So that means delaying only some specific events. Fortunately document
event events don't implement Begin/EndEvent so it should technically be doable (delaying EndEvent would cause a huge mess to the ObservationContext).