No Notification Mails Are Sent Upon Page Update

Hello,

our xwiki installation (debian stable version 11.10.10) has an issue with sending notification mails, e.g. upon page updates. From catalina.out I’m getting the following error:

2020-10-26 00:00:00,084 [DefaultQuartzScheduler_Worker-5] ERROR o.q.c.JobRunShell              - Job DEFAULT.xwiki:Scheduler.NotificationEmailDailySender_0 threw an unhandled Exception:
java.lang.ClassCastException: com.xpn.xwiki.objects.LargeStringProperty cannot be cast to com.xpn.xwiki.objects.ListProperty
        at com.xpn.xwiki.objects.BaseCollection.getListValue(BaseCollection.java:490)

Other mails, e.g. for registration, are send perfectly.
From the exception it seems that this may be due to some xwiki object property that may contain a large list of pages, but I could not find anything suspicious looking into /xwiki/notifications/code. Also, it seems as if this is related to the WatchlistBridgeProvider. Should I disable it?

Could you please point me to direction where I could check for this LargeStringProperty, which classes are involved etc.?

Here is the full stack trace from catalina.out:
2020-10-26 00:00:00,084 [DefaultQuartzScheduler_Worker-5] ERROR o.q.c.JobRunShell - Job DEFAULT.xwiki:Scheduler.N
otificationEmailDailySender_0 threw an unhandled Exception:
java.lang.ClassCastException: com.xpn.xwiki.objects.LargeStringProperty cannot be cast to com.xpn.xwiki.objects.ListProperty
at com.xpn.xwiki.objects.BaseCollection.getListValue(BaseCollection.java:490)
at org.xwiki.notifications.filters.watchlistbridge.internal.WatchlistBridgeProvider.getValues(WatchlistBridgeProvider.
java:128)
at org.xwiki.notifications.filters.watchlistbridge.internal.WatchlistBridgeProvider.getFilterPreferences(WatchlistBrid
geProvider.java:116)
at org.xwiki.notifications.filters.internal.DefaultNotificationFilterPreferenceManager.getFilterPreferences(DefaultNot
ificationFilterPreferenceManager.java:75)
at org.xwiki.notifications.sources.internal.DefaultNotificationManager.getEvents(DefaultNotificationManager.java:139)
at org.xwiki.notifications.sources.internal.DefaultNotificationManager.getEvents(DefaultNotificationManager.java:119)
at org.xwiki.notifications.notifiers.internal.email.DefaultPeriodicMimeMessageIterator.retrieveCompositeEventList(DefaultPeriodicMimeMessageIterator.java:65)
at org.xwiki.notifications.notifiers.internal.email.AbstractMimeMessageIterator.computeNext(AbstractMimeMessageIterator.java:166)
at org.xwiki.notifications.notifiers.internal.email.AbstractMimeMessageIterator.initialize(AbstractMimeMessageIterator.java:141)
at org.xwiki.notifications.notifiers.internal.email.DefaultPeriodicMimeMessageIterator.initialize(DefaultPeriodicMimeMessageIterator.java:59)
at org.xwiki.notifications.notifiers.internal.email.NotificationEmailSender.sendEmails(NotificationEmailSender.java:84)
at org.xwiki.notifications.notifiers.internal.email.NotificationEmailJob.executeJob(NotificationEmailJob.java:70)
at com.xpn.xwiki.plugin.scheduler.AbstractJob.execute(AbstractJob.java:76)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
2020-10-26 00:00:00,085 [DefaultQuartzScheduler_Worker-5] ERROR c.x.x.p.s.i.StatusListener - Job (DEFAULT.xwiki:Scheduler.NotificationEmailDailySender_0 threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception.
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.lang.ClassCastException: com.xpn.xwiki.objects.LargeStringProperty cannot be cast to com.xpn.xwiki.objects.ListProperty
at com.xpn.xwiki.objects.BaseCollection.getListValue(BaseCollection.java:490)
at org.xwiki.notifications.filters.watchlistbridge.internal.WatchlistBridgeProvider.getValues(WatchlistBridgeProvider.java:128)
at org.xwiki.notifications.filters.watchlistbridge.internal.WatchlistBridgeProvider.getFilterPreferences(WatchlistBridgeProvider.java:116)
at org.xwiki.notifications.filters.internal.DefaultNotificationFilterPreferenceManager.getFilterPreferences(DefaultNotificationFilterPreferenceManager.java:75)
at org.xwiki.notifications.sources.internal.DefaultNotificationManager.getEvents(DefaultNotificationManager.java:139)
at org.xwiki.notifications.sources.internal.DefaultNotificationManager.getEvents(DefaultNotificationManager.java:119)
at org.xwiki.notifications.notifiers.internal.email.DefaultPeriodicMimeMessageIterator.retrieveCompositeEventList(DefaultPeriodicMimeMessageIterator.java:65)
at org.xwiki.notifications.notifiers.internal.email.AbstractMimeMessageIterator.computeNext(AbstractMimeMessageIterator.java:166)
at org.xwiki.notifications.notifiers.internal.email.AbstractMimeMessageIterator.initialize(AbstractMimeMessageIterator.java:141)
at org.xwiki.notifications.notifiers.internal.email.DefaultPeriodicMimeMessageIterator.initialize(DefaultPeriodicMimeMessageIterator.java:59)
at org.xwiki.notifications.notifiers.internal.email.NotificationEmailSender.sendEmails(NotificationEmailSender.java:84)
at org.xwiki.notifications.notifiers.internal.email.NotificationEmailJob.executeJob(NotificationEmailJob.java:70)
at com.xpn.xwiki.plugin.scheduler.AbstractJob.execute(AbstractJob.java:76)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
… 1 common frames omitted
2020-10-26 00:00:00,085 [DefaultQuartzScheduler_Worker-5] ERROR o.q.c.ErrorLogger - Job (DEFAULT.xwiki:Scheduler.NotificationEmailDailySender_0 threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception.
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.lang.ClassCastException: com.xpn.xwiki.objects.LargeStringProperty cannot be cast to com.xpn.xwiki.objects.ListProperty
at com.xpn.xwiki.objects.BaseCollection.getListValue(BaseCollection.java:490)
at org.xwiki.notifications.filters.watchlistbridge.internal.WatchlistBridgeProvider.getValues(WatchlistBridgeProvider.java:128)
at org.xwiki.notifications.filters.watchlistbridge.internal.WatchlistBridgeProvider.getFilterPreferences(WatchlistBridgeProvider.java:116)
at org.xwiki.notifications.filters.internal.DefaultNotificationFilterPreferenceManager.getFilterPreferences(DefaultNotificationFilterPreferenceManager.java:75)
at org.xwiki.notifications.sources.internal.DefaultNotificationManager.getEvents(DefaultNotificationManager.java:139)
at org.xwiki.notifications.sources.internal.DefaultNotificationManager.getEvents(DefaultNotificationManager.java:119)
at org.xwiki.notifications.notifiers.internal.email.DefaultPeriodicMimeMessageIterator.retrieveCompositeEventList(DefaultPeriodicMimeMessageIterator.java:65)
at org.xwiki.notifications.notifiers.internal.email.AbstractMimeMessageIterator.computeNext(AbstractMimeMessageIterator.java:166)
at org.xwiki.notifications.notifiers.internal.email.AbstractMimeMessageIterator.initialize(AbstractMimeMessageIterator.java:141)
at org.xwiki.notifications.notifiers.internal.email.DefaultPeriodicMimeMessageIterator.initialize(DefaultPeriodicMimeMessageIterator.java:59)
at org.xwiki.notifications.notifiers.internal.email.NotificationEmailSender.sendEmails(NotificationEmailSender.java:84)
at org.xwiki.notifications.notifiers.internal.email.NotificationEmailJob.executeJob(NotificationEmailJob.java:70)
at com.xpn.xwiki.plugin.scheduler.AbstractJob.execute(AbstractJob.java:76)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
… 1 common frames omitted

Having a look into WatchList I’ve noticed that it was removed in a previous version. Though, most user profiles still have a XWiki.WatchListClass object attached.
Could this be the cause of the error?

Also, I tried to list all XWiki.WatchListClass objects of all Users but failed to get the object using REST-API.

Actually what the error suggest is that the migration for Loading... was not executed in your case. As if you upgraded directly from a <7.0 (where the format of that fields was changed) to >=11.1 (where the watchlist was removed from XWiki Standard).

Since it’s a valid use case IMO I think the bridge should be improved to support both use cases (LargeStringProperty and ListProperty property type for the list of watched documents).

Looking at it.

Edit: see Loading...

What you could do while waiting for 11.10.11 release is download the latest JAR in Repository - Sonatype Nexus Repository and replace /usr/lib/xwiki/WEB-INF/lib/xwiki-platform-notifications-filters-watchlistbridge-11.10.10.jar with it (keep the 11.10.10 name so that the next apt upgrade replace it with the proper one when you totally forgot that you patched it :slight_smile: ).

1 Like

Thank you, the new jar solved the issue!