2023-12-28 11:34:53,297 [qtp1373810119-155 - http://localhost:8080/xwiki/bin/skin/resources/uicomponents/search/searchSuggest.min.js?cache-version=1703757519589&h=1255116547] ERROR c.x.x.XWiki - Error while parsing velocity template namespace [/resources/uicomponents/search/searchSuggest.min.js] with content:
[/*
## Iterate over the sources defined in the configuration document, and create a source array to be passed to the
## search suggest contructor.
#set ($sources = [])
#set ($searchSuggestConfig = $xwiki.getDocument('XWiki.SearchSuggestConfig'))
#foreach ($source in $searchSuggestConfig.getObjects('XWiki.SearchSuggestSourceClass'))
#if ($source.getProperty('activated').value == 1)
#set ($engine = $source.getProperty('engine').value)
#if ("$!engine" == '')
## For backward compatibility we consider the search engine to be Lucene when it's no specified.
#set ($engine = 'lucene')
#end
#set ($discard = $xwiki.getDocument('XWiki.SearchCode').getRenderedContent())
#if ($engine == $searchEngine)
#set ($evaluatedSource = $source.evaluate())
#set ($name = $source.getProperty('name').value)
#if ($services.localization.get($name))
#set ($name = $services.localization.render($name))
#else
## Evaluate the Velocity code for backward compatibility.
#set ($name = $evaluatedSource.name)
#end
#set ($icon = $source.getProperty('icon').value)
#if ($icon.startsWith('icon:'))
#set ($icon = $xwiki.getSkinFile("icons/silk/${icon.substring(5)}.png"))
#else
## Evaluate the Velocity code for backward compatibility.
#set ($icon = $evaluatedSource.icon)
#end
#set ($service = $source.getProperty('url').value)
#set ($parameters = {
'query': $source.getProperty('query').value,
'nb': $source.getProperty('resultsNumber').value
})
#if ($xwiki.exists($service))
#set ($discard = $parameters.put('outputSyntax', 'plain'))
#set ($service = $xwiki.getURL($service, 'get', $escapetool.url($parameters)))
#else
## Evaluate the Velocity code for backward compatibility.
#set ($service = "#evaluate($service)")
#set ($service = "$service#if ($service.contains('?'))&#else?#end$escapetool.url($parameters)")
#end
#set ($highlight = $source.getProperty('highlight').value == 1)
#set ($discard = $sources.add({
'name': $name,
'varname': 'input',
'script': $service,
'icon': $icon,
'highlight': $highlight
}))
#end
#end
#end
*/
'use strict';var XWiki=function(c){c.SearchSuggest=Class.create({initialize:function(a,b){this.sources=b;if(this.searchInput=$(a))document.observe("xwiki:suggest:clearSuggestions",this.onClearSuggestions.bindAsEventListener(this)),document.observe("xwiki:suggest:containerCreated",this.onSuggestContainerCreated.bindAsEventListener(this)),document.observe("xwiki:suggest:containerPrepared",this.onSuggestContainerPrepared.bindAsEventListener(this)),document.observe("xwiki:suggest:updated",this.onSuggestUpdated.bindAsEventListener(this)),
document.observe("xwiki:suggest:selected",this.onSuggestionSelected.bindAsEventListener(this)),document.observe("xwiki:suggest:collapsed",this.onSuggestCollapsed.bindAsEventListener(this)),this.createSuggest()},onClearSuggestions:function(a){a.memo.suggest==this.suggest&&this.searchInput.setStyle({borderBottomStyle:this.searchInputBorderBottomSavedStyle})},onSuggestContainerCreated:function(a){a.memo.suggest==this.suggest&&(this.searchInputBorderBottomSavedStyle=this.searchInput.getStyle("borderBottomStyle"),
this.searchInput.setStyle({borderBottomStyle:"none"}))},onSuggestContainerPrepared:function(a){this.noResultsMessage.addClassName("hidden")},onSuggestUpdated:function(a){1===a.memo.container.select(".suggestItem").length&&this.noResultsMessage.removeClassName("hidden").setStyle({"float":"left"})},onSuggestionSelected:function(a){a.memo.suggest==this.suggest&&(a.stop(),a.memo.originalEvent&&Event.stop(a.memo.originalEvent),a.memo.url?window.location=a.memo.url:this.searchInput.up("form").submit())},
onSuggestCollapsed:function(a){this.suggest.clearSuggestions()},createSuggest:function(){var a=(new Element("div")).insert(new Element("span",{"class":"suggestId"})).insert(new Element("span",{"class":"suggestValue"})).insert(new Element("span",{"class":"suggestInfo"}));this.noResultsMessage=(new Element("div",{"class":"hidden"})).update("$escapetool.javascript($services.localization.render('core.widgets.suggest.noResults'))".escapeHTML());var b=(new Element("div")).update("$escapetool.javascript($services.localization.render('core.widgets.suggest.showResults'))".escapeHTML());
b=(new Element("div")).insert(this.noResultsMessage).insert(b).insert(new Element("div",{"class":"clearfloats"}));a=new c.widgets.XList([new c.widgets.XListItem(b,{containerClasses:"suggestItem",classes:"showAllResults",eventCallbackScope:this,noHighlight:!0,value:a,containerTagName:"button"})],{classes:"suggestList",eventListeners:{mouseover:function(d){this.suggest.setHighlight(d.currentTarget)}}});b=a.getElement();a.items[0].getElement().addEventListener("focusin",d=>this.suggest.setHighlight($(d.currentTarget)));
this.suggest=new c.widgets.Suggest(this.searchInput,{parentContainer:$("globalsearch"),className:"searchSuggest horizontalLayout",fadeOnClear:!1,align:"auto",minchars:3,sources:this.sources,insertBeforeSuggestions:(new Element("div",{"class":"results"})).update(b),displayValue:!0,displayValueText:"$escapetool.javascript($services.localization.render('platform.search.suggestResultLocatedIn'))",resultInfoHTML:!0,timeout:0,width:500,unifiedLoader:!0,loaderNode:b.down("li"),shownoresults:!1,propagateEventKeyCodes:[Event.KEY_RETURN]})}});
var e=function(){var a=$jsontool.serialize($sources);new c.SearchSuggest($("headerglobalsearchinput"),a);return!0};c.isInitialized&&e()||document.observe("xwiki:dom:loading",e);return c}(XWiki);
//# sourceMappingURL=searchSuggest.min.js.map
]
org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with namespace [/resources/uicomponents/search/searchSuggest.min.js]
at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:227)
at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:173)
at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:163)
at com.xpn.xwiki.internal.velocity.DefaultVelocityEvaluator.evaluateVelocity(DefaultVelocityEvaluator.java:79)
at com.xpn.xwiki.XWiki.evaluateVelocity(XWiki.java:6364)
at com.xpn.xwiki.XWiki.evaluateVelocity(XWiki.java:6383)
at com.xpn.xwiki.web.SkinAction.lambda$evaluateVelocity$0(SkinAction.java:407)
at com.xpn.xwiki.internal.security.authorization.DefaultAuthorExecutor.call(DefaultAuthorExecutor.java:98)
at com.xpn.xwiki.web.SkinAction.evaluateVelocity(SkinAction.java:407)
at com.xpn.xwiki.web.SkinAction.renderFileFromFilesystem(SkinAction.java:304)
at com.xpn.xwiki.web.SkinAction.render(SkinAction.java:179)
at com.xpn.xwiki.web.SkinAction.render(SkinAction.java:105)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:637)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:339)
at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1419)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:61)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:210)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
at org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:170)
at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:598)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1570)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1384)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1543)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1306)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:192)
at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:51)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
at org.eclipse.jetty.server.Server.handle(Server.java:563)
at org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598)
at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:287)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)
at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:199)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'evaluate' in class com.xpn.xwiki.api.Object threw exception org.xwiki.evaluation.ObjectEvaluatorException: Could not find an instance of 'ObjectEvaluator' for XObject of class 'XWiki.SearchSuggestSourceClass'. at /resources/uicomponents/search/searchSuggest.min.js[line 15, column 44]
at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:308)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:235)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:368)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:704)
at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:75)
at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:242)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:171)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:171)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:147)
at org.apache.velocity.runtime.directive.Foreach.renderBlock(Foreach.java:309)
at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:279)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:304)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:439)
at org.apache.velocity.Template.merge(Template.java:358)
at org.apache.velocity.Template.merge(Template.java:262)
at org.xwiki.velocity.internal.InternalVelocityEngine.evaluate(InternalVelocityEngine.java:225)
... 73 common frames omitted
Caused by: org.xwiki.evaluation.ObjectEvaluatorException: Could not find an instance of 'ObjectEvaluator' for XObject of class 'XWiki.SearchSuggestSourceClass'.
at org.xwiki.evaluation.internal.DefaultObjectEvaluator.evaluate(DefaultObjectEvaluator.java:70)
at com.xpn.xwiki.objects.BaseObject.evaluate(BaseObject.java:456)
at com.xpn.xwiki.api.Object.evaluate(Object.java:179)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:571)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:554)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:221)
... 89 common frames omitted