NotificationException in 10.8.1

@gdelhumeau

It was already briefly discussed here, but I’m still getting these errors.

@vmassol pointed out, that my installation is missing a table notification_filter_prefs in the database.

How can I fix this???
Thanks!

org.xwiki.notifications.NotificationException: Error while loading the notification filter preferences of the user [xwiki:XWiki.Frieder-Schrempf].
        at org.xwiki.notifications.filters.internal.NotificationFilterPreferenceStore.getPreferencesOfUser(NotificationFilterPreferenceStore.java:121)
        at org.xwiki.notifications.filters.internal.DefaultModelBridge.getInternalFilterPreferences(DefaultModelBridge.java:93)
        at org.xwiki.notifications.filters.internal.DefaultModelBridge.getFilterPreferences(DefaultModelBridge.java:100)
        at org.xwiki.notifications.filters.internal.CachedModelBridge.getFilterPreferences(CachedModelBridge.java:113)
        at org.xwiki.notifications.filters.internal.UserProfileNotificationFilterPreferenceProvider.getFilterPreferences(UserProfileNotificationFilterPreferenceProvider.java:59)
        at org.xwiki.notifications.filters.internal.DefaultNotificationFilterManager.getFilterPreferences(DefaultNotificationFilterManager.java:154)
        at org.xwiki.notifications.filters.watch.WatchedLocationReference.isWatched(WatchedLocationReference.java:89)
        at org.xwiki.notifications.filters.watch.internal.DefaultWatchedEntitiesManager.entityIsAlreadyInDesiredState(DefaultWatchedEntitiesManager.java:139)
        at org.xwiki.notifications.filters.watch.internal.DefaultWatchedEntitiesManager.handleEntity(DefaultWatchedEntitiesManager.java:95)
        at org.xwiki.notifications.filters.watch.internal.DefaultWatchedEntitiesManager.watchEntity(DefaultWatchedEntitiesManager.java:63)
        at org.xwiki.notifications.filters.watch.internal.AutomaticWatchModeListener.documentModifiedHandler(AutomaticWatchModeListener.java:135)
        at org.xwiki.notifications.filters.watch.internal.AutomaticWatchModeListener.onEvent(AutomaticWatchModeListener.java:106)
        at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:304)
        at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:269)
        at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1830)
        at com.xpn.xwiki.XWiki.saveDocument(XWiki.java:1736)
        at com.xpn.xwiki.XWiki.addUserToGroup(XWiki.java:3935)
        at com.xpn.xwiki.XWiki.setUserDefaultGroup(XWiki.java:3919)
        at org.xwiki.contrib.oidc.auth.internal.OIDCUserManager.updateUser(OIDCUserManager.java:305)
        at org.xwiki.contrib.oidc.auth.internal.OIDCUserManager.updateUserInfo(OIDCUserManager.java:190)
        at org.xwiki.contrib.oidc.auth.internal.OIDCUserManager.updateUserInfo(OIDCUserManager.java:162)
        at org.xwiki.contrib.oidc.auth.internal.endpoint.CallbackOIDCEndpoint.handle(CallbackOIDCEndpoint.java:149)
        at org.xwiki.contrib.oidc.provider.internal.OIDCResourceReferenceHandler.handle(OIDCResourceReferenceHandler.java:134)
        at org.xwiki.contrib.oidc.provider.internal.OIDCResourceReferenceHandler.handle(OIDCResourceReferenceHandler.java:108)
        at org.xwiki.resource.internal.DefaultResourceReferenceHandlerChain.handleNext(DefaultResourceReferenceHandlerChain.java:79)
        at org.xwiki.resource.internal.AbstractResourceReferenceHandlerManager.handle(AbstractResourceReferenceHandlerManager.java:82)
        at org.xwiki.resource.servlet.ResourceReferenceHandlerServlet.handleResourceReference(ResourceReferenceHandlerServlet.java:159)
        at org.xwiki.resource.servlet.ResourceReferenceHandlerServlet.service(ResourceReferenceHandlerServlet.java:87)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:470)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:356)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:316)
        at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:147)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.xwiki.query.QueryException: Exception while executing query. Query statement = [select nfp from DefaultNotificationFilterPreference nfp where nfp.owner = :owner order by nfp.id]
        at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.execute(HqlQueryExecutor.java:195)
        at org.xwiki.query.internal.DefaultQueryExecutorManager.execute(DefaultQueryExecutorManager.java:72)
        at org.xwiki.query.internal.DefaultQuery.execute(DefaultQuery.java:296)
        at org.xwiki.notifications.filters.internal.NotificationFilterPreferenceStore.getPreferencesOfUser(NotificationFilterPreferenceStore.java:113)
        ... 57 common frames omitted
Caused by: com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute
        at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:927)
        at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeRead(XWikiHibernateBaseStore.java:990)
        at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.execute(HqlQueryExecutor.java:177)
        ... 60 common frames omitted
Caused by: org.hibernate.hql.ast.QuerySyntaxException: DefaultNotificationFilterPreference is not mapped [select nfp from DefaultNotificationFilterPreference nfp where nfp.owner = :owner order by nfp.id]
        at org.hibernate.hql.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:180)
        at org.hibernate.hql.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:111)
        at org.hibernate.hql.ast.tree.FromClause.addFromElement(FromClause.java:93)
        at org.hibernate.hql.ast.HqlSqlWalker.createFromElement(HqlSqlWalker.java:327)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3441)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3325)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:733)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:584)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:301)
        at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:244)
        at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:256)
        at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:187)
        at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:138)
        at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
        at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
        at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124)
        at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
        at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
        at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1770)
        at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.createHibernateQuery(HqlQueryExecutor.java:220)
        at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor$1.doInHibernate(HqlQueryExecutor.java:183)
        at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor$1.doInHibernate(HqlQueryExecutor.java:178)
        at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:921)
        ... 62 common frames omitted
2018-10-30 22:31:08,574 [http://wiki.einanderergottesdienst.de/bin/view/Main/] ERROR o.x.v.i.DefaultVelocityEngine  - Exception in macro #displayCheckedIfWatched called at 129:xwiki:XWiki.Notifications.Code.NotificationsDisplayerUIX^XWiki.UIExtensionClass[0][line 36, column 55] 
2018-10-30 22:31:08,638 [http://wiki.einanderergottesdienst.de/bin/view/Main/] ERROR o.x.v.i.DefaultVelocityEngine  - Exception in macro #displayCheckedIfWatched called at 129:xwiki:XWiki.Notifications.Code.NotificationsDisplayerUIX^XWiki.UIExtensionClass[0][line 36, column 55] 

Hello.

In your docker image, could you look at the file named WEB-INF/hibernate.cfg.xml?

Inside it, you should find the following lines:

<mapping resource="mailsender.hbm.xml"/>
<mapping resource="notification-filter-preferences.hbm.xml"/>

Maybe the last line is missing (which should have been normally fixed by XDOCKER-80).

Also, make sure you have:

xwiki.store.migration=1

in xwiki.cfg. It’s here by default but it doesn’t cost to check it.

These are the 2 solutions I can think about.

I hope it helps,

Guillaume

Thank your for your help. Indeed, the last line was missing. I added it and the issue seems to be fixed now.

You just need to “docker pull” actually since this was fixed in the image some time ago :wink:

That’s what I did. But somehow it didn’t help, or I’m doing something wrong…