Xwiki Macro failure in Default Notification Filter Preference

Hi all,

I have issues displaying the user’s profile page since some versions of xwiki and it is not fixed until now.

When I call the profile page of an user, I will get the following error:

   Failed to execute the [velocity] macro. Cause: [DefaultNotificationFilterPreference is not mapped [select nfp from DefaultNotificationFilterPreference nfp where nfp.owner = :owner order by nfp.id]].

org.xwiki.rendering.macro.MacroExecutionException: Failed to evaluate Velocity Macro for content [#set ($discard = $xwiki.ssx.use(‘XWiki.XWikiUserSheet’))

#set ($inEditMode = $xcontext.action == ‘edit’ || $xcontext.action == ‘inline’)
#set ($xwikiUsersClassName = ‘XWiki.XWikiUsers’)
#set ($obj = $doc.getObject($xwikiUsersClassName))

#if (!$obj)
= $services.localization.render(‘xe.admin.users.sheet’) =

{{info}}$services.localization.render(‘xe.admin.users.applyonusers’){{/info}}

#else

Make sure we only care about properties of the user object and don’t get polluted by other objects that might be in the user’s profile page.

#set ($discard = $doc.use($obj))

#set ($sheetDocumentReference = $services.model.createDocumentReference($xcontext.database, ‘XWiki’, ‘AdminUserProfileSheet’))
#set ($sheetDocument = $xwiki.getDocument($sheetDocumentReference))
#set ($xwikiUsersClass = $xwiki.getClass($xwikiUsersClassName))

#set ($sectionsObjectClassName = ‘XWiki.UserProfileSectionsClass’)
#set ($sectionObjectClassName = ‘XWiki.UserProfileSectionClass’)

{{html clean=‘false’ wiki=‘true’}}
#if (!$inEditMode)

$xwiki.getUserName($doc.fullName, false) #end
#if($xcontext.action == 'view' && $hasEdit) #end ## Please do not insert extra empty lines here (as it affects the validity of the rendered xhtml) #set ($sectionsObject = $sheetDocument.getObject($sectionsObjectClassName)) #set ($sectionsToDisplayString = $sectionsObject.getProperty('sections').value) #set ($sectionsToDisplay = $sectionsToDisplayString.split('\s+')) #foreach ($sectionId in $sectionsToDisplay) #set ($sectionObject = $sheetDocument.getObject($sectionObjectClassName, 'id', $sectionId)) #set ($sectionName = "$!sectionObject.getProperty('name').value") ## The section name will be evaluated. The admin can specify a static string or a call to $msg(...) to provide internationalization support. #set ($sectionName = "#evaluate($!sectionName)") ## If there is no section name specified, use the default translations prefix for the user profile, maybe we get lucky. #if ("$!sectionName" == '') #set ($sectionName = $services.localization.render("platform.core.profile.section.${sectionId}")) #end ## If that does not work either, just display the sectionID. #if ("$!sectionName" == "platform.core.profile.section.${sectionId}") #set ($sectionName = $sectionId) #end #set ($sectionPropertiesString = $sectionObject.getProperty('properties').value) #set ($sectionProperties = $sectionPropertiesString.split('\s+')) #if ($sectionProperties && $sectionProperties.size() > 0)

$sectionName

#foreach ($sectionProperty in $sectionProperties) #set ($vCardData = $sectionProperty.split(':')) #set ($vCardProperty = '') #if ($vCardData.size() == 2) #set ($vCardProperty = $vCardData[0]) #set ($sectionProperty = $vCardData[1]) #end #if ("$!sectionProperty" != '' && $xwikiUsersClass.get($sectionProperty))
$doc.displayPrettyName("${sectionProperty}")
$doc.display($sectionProperty)
#end #end
#end #end
#if (!$inEditMode)
#set ($isMessageStreamActive = $services.messageStream.isActive()) #if ($isMessageStreamActive && !$isGuest)

$services.localization.render('platform.core.profile.section.sendMessage')

      {{messageSender /}}

  </div>
  #end
  <div class='userRecentChanges'>
  #if ($xcontext.user == $doc.fullName)
    <h1>$services.localization.render('platform.core.profile.section.activity')</h1>
  #else
    <h1>$services.localization.render('platform.core.profile.section.activityof', [$xwiki.getUserName($doc.fullName, false)])</h1>
    #if ($hasWatch)
    $xwiki.ssx.use('XWiki.XWikiUserProfileSheet')##
    <div class='activity-follow'>
      #set ($xredirect = $doc.getURL($xcontext.action, $request.queryString))
      #if ($services.watchlist.isWatched(${doc.prefixedFullName}, "USER"))
      <span class='following'>$services.localization.render('xe.activity.messages.following')</span>
      <a class='action unfollow' href="$doc.getURL('view', "xpage=watch&amp;do=removeuser&amp;xredirect=${escapetool.url($xredirect)}")">$services.localization.render('xe.activity.messages.unfollow')</a>
      #else
      <a class='action follow' href="$doc.getURL('view', "xpage=watch&amp;do=adduser&amp;xredirect=${escapetool.url($xredirect)}")">$services.localization.render('xe.activity.messages.follow')</a>
      #end
    </div>
    #end
    <div class="activity-follow">
    #if("$!services.notification.watch" != '' && $services.notification.watch.isEnabled() && !$isGuest && !$isSuperAdmin)
      ## TODO: replace it, somehow, by a UIX or a custom user sheet
      #set ($discard = $xwiki.ssx.use('XWiki.XWikiUserProfileSheet'))
      #set ($discard = $xwiki.jsx.use('XWiki.XWikiUserProfileSheet'))
      <div class="notificationWatchUser">
        <p>$services.icon.renderHTML('bell') $escapetool.xml($services.localization.render('user.profile.notifications'))</p>
        #set ($userId = $services.model.serialize($doc.documentReference, 'default'))
        #set ($isUserWatched = $services.notification.watch.isUserWatched($userId))
        <div class="notificationWatchUserFollowing #if(!$isUserWatched)hidden#end">
          <button type="button" class="btn btn-success dropdown-toggle btn-xs" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            $services.icon.renderHTML('check') $escapetool.xml($services.localization.render('user.profile.network.following')) <span class="caret"></span>
          </button>
          <ul class="dropdown-menu">
            <li><a href="#" class="notificationWatchUserRemove">$services.icon.renderHTML('cross') $escapetool.xml($services.localization.render('user.profile.network.unfollow'))</a></li>
          </ul>
        </div>
        <div class="notificationWatchUserNotFollowing  #if($isUserWatched)hidden#end">
          <button type="button" class="btn btn-danger dropdown-toggle btn-xs" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            $escapetool.xml($services.localization.render('user.profile.network.notfollowing')) <span class="caret"></span>
          </button>
          <ul class="dropdown-menu">
            <li><a href="#" class="notificationWatchUserAdd">$services.icon.renderHTML('eye') $escapetool.xml($services.localization.render('user.profile.network.follow'))</a></li>
          </ul>
        </div>
      </div>
    #end
    </div>
  #end

{{/html}}

{{notifications useUserPreferences=“false” displayOwnEvents=“true” users="${doc.prefixedFullName}" displayRSSLink=“false” /}}

{{html clean=‘false’}}



#end
 
#if(!$inEditMode) ## Close the vcard
#end {{/html}}## #end] at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:139) at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:52) 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:297) at org.xwiki.rendering.internal.transformation.DefaultRenderingContext.transformInContext(DefaultRenderingContext.java:183) at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:101) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:263) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:133) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:58) at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:96) at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:39) at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:245) at org.xwiki.sheet.internal.SheetDocumentDisplayer.applySheet(SheetDocumentDisplayer.java:225) at org.xwiki.sheet.internal.SheetDocumentDisplayer.maybeDisplayWithSheet(SheetDocumentDisplayer.java:180) at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:111) at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:52) at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:68) at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:42) at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1202) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1243) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1220) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:1251) at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:736) at sun.reflect.GeneratedMethodAccessor751.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567) at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71) at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.xwiki.velocity.introspection.TryCatchDirective.render(TryCatchDirective.java:87) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222) at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:357) at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:825) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:701) at com.xpn.xwiki.internal.template.InternalTemplateManager.lambda$renderFromSkin$0(InternalTemplateManager.java:676) at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:85) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:675) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:654) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:640) at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:78) at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2270) at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:2248) at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:992) at sun.reflect.GeneratedMethodAccessor381.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222) at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:357) at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:825) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:701) at com.xpn.xwiki.internal.template.InternalTemplateManager.lambda$renderFromSkin$0(InternalTemplateManager.java:676) at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:85) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:675) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:654) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:640) at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:78) at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2270) at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:2248) at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:992) at sun.reflect.GeneratedMethodAccessor381.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222) at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:357) at com.xpn.xwiki.internal.template.InternalTemplateManager.evaluateContent(InternalTemplateManager.java:825) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:701) at com.xpn.xwiki.internal.template.InternalTemplateManager.lambda$renderFromSkin$0(InternalTemplateManager.java:676) at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:85) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:675) at com.xpn.xwiki.internal.template.InternalTemplateManager.renderFromSkin(InternalTemplateManager.java:654) at com.xpn.xwiki.internal.template.InternalTemplateManager.render(InternalTemplateManager.java:640) at com.xpn.xwiki.internal.template.DefaultTemplateManager.render(DefaultTemplateManager.java:78) at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:2270) at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:179) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:475) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:209) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:112) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:126) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:134) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:868) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) 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.velocity.XWikiVelocityException: Failed to evaluate content with id [xwiki:XWiki.XWikiUserSheet] at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:227) at com.xpn.xwiki.render.DefaultVelocityManager.evaluate(DefaultVelocityManager.java:357) at org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluateString(VelocityMacro.java:131) ... 162 more Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'isUserWatched' in class org.xwiki.notifications.filters.watch.script.NotificationWatchScriptService threw exception org.xwiki.notifications.NotificationException: Error while loading the notification filter preferences of the user [xwiki:XWiki.Farrenkopf]. at 3581:xwiki:XWiki.XWikiUserSheet[line 110, column 53] at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:243) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:187) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567) at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71) at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluateInternal(DefaultVelocityEngine.java:259) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:222) ... 164 more Caused by: org.xwiki.notifications.NotificationException: Error while loading the notification filter preferences of the user [xwiki:XWiki.Farrenkopf]. 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.DefaultNotificationFilterPreferenceManager.getFilterPreferences(DefaultNotificationFilterPreferenceManager.java:75) at org.xwiki.notifications.filters.watch.WatchedUserReference.isWatched(WatchedUserReference.java:71) at org.xwiki.notifications.filters.watch.script.NotificationWatchScriptService.isUserWatched(NotificationWatchScriptService.java:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) ... 181 more 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) ... 195 more 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) ... 198 more 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.(HQLQueryPlan.java:101) at org.hibernate.engine.query.HQLQueryPlan.(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) ... 200 more

What can I do?

Got it!

It was an issue reported as XWIKI-15745.

You have to add notification-filter-preferences.hbm.xml to hibernate.cfg.xml. This will fix it.