See below for extended error-report
I also paste the code
Op 17 jan 2010, om 18:12 heeft Flavius Olaru het volgende geschreven:
On Sun, Jan 17, 2010 at 1:35 PM, Gerritjan Koekkoek
<gerritjankoekkoek(a)gmail.com> wrote:
Navigating to the Main.LuceneSearch page brings up the
following error?
Failed to execute macro: velocity
org.xwiki.rendering.macro.MacroExecutionException: Failed to evaluate Velocity Macro for
content [$xwiki.jsfx.use("uicomponents/search/search.js", true)##
$xwiki.ssfx.use("uicomponents/search/search.css", true)##
The page has worked, but what can be wrong now.
The page itself is not changed from the distribution?
Gerritjan
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
Hi Gerritjan,
Can you paste in more information about the error?
--
Flavius Olaru
## Disable the document extra data: comments, attachments, history...
#set($docextras = [])
## ===================
## Lucene search
## ===================
## Inputs : $request.text
## Outputs : $list, $isScored
## ===================
## Uncomment this line to overload the maximum list of wiki where to search (also the one
listed in the wikis combobox)
## #set($allwikinamelist = ["xwiki", "wiki1", "wiki2"])
##
## Uncomment this line to overload the wikis where to search
## #set($wikinames = "xwiki,wiki,wiki")
##
## Uncomment this line to overload the languages to search
## #set($languages = "default,en,de")
#set ($rssmode = ("$!request.xpage" == 'plain'))
## ---------------
## Space filtering
## ---------------
#set($extraClause = '')
#set($selectedSpace = "$!request.space")
#if($selectedSpace != '' && !$blacklistedSpaces.contains($selectedSpace))
#set($extraClause = " AND web:${selectedSpace}")
#end
## ----------------------------------------------------------------------
## Exclude Blacklisted spaces ($blacklistedSpaces is set in xwikivars.vm)
## Also exclude WebPreferences.
## ----------------------------------------------------------------------
#foreach ($blacklistedSpace in $blacklistedSpaces)
#set ($extraClause = " AND NOT web:${blacklistedSpace}${extraClause}")
#end
#if(!$hasAdmin && !$isAdvancedUser)
#set ($extraClause = " AND NOT name:WebPreferences${extraClause}")
#end
## ---------------
## Space macros
## ---------------
#macro(spaceoption $space $selectedSpace)
<option value="${space}" #if($selectedSpace ==
$space)selected="selected"#end>$space</option>
#end
#macro(spaceselect $selectedSpace $spaces)
<select name="space"
title="$msg.get('xe.search.bar.spaces.title')">
<option value="" #if($selectedSpace ==
'')selected="selected"#end>$msg.get('xe.search.bar.spaces.all')</option>
#foreach($space in $xwiki.spaces)
#if (!$blacklistedSpaces.contains($space))
#spaceoption($space $selectedSpace)
#end
#end
</select>
#end
## ---------------
## Wikis filtering
## ---------------
#set($wikinamelist = [])
#if(!$wikinames)
#set($wikinametable = $request.getParameterValues("wikinames"))
#if(!$wikinametable || $request.wikinames == "")
#set($wikinametable = $allwikinamelist)
#end
#set($wikinames = "")
#foreach($wikiname in $wikinametable)
#set($ok = $wikinamelist.add($wikiname))
#if($wikinames != "")
#set($wikinames = $wikinames + ",")
#end
#set($wikinames = $wikinames + $wikiname)
#end
#else
#set($wikinametable = $wikinames.split(", "))
#foreach($wikiname in $wikinametable)
#set($ok = $wikinamelist.add($wikiname))
#end
#end
##
#if($xwiki.isVirtualMode())
#if(!$allwikinamelist)
#set($currentwikiname = $context.database)
#set($ok = $context.setDatabase($context.mainWikiName))
#set($allwikilist = $xwiki.searchDocuments(", BaseObject as obj, StringProperty
as prop where doc.fullName=obj.name and obj.className='XWiki.XWikiServerClass' and
prop.id.id=obj.id and prop.id.name='server'"))
#set($ok = $context.setDatabase($currentwikiname))
##
#set($allwikinamelist = [])
#foreach($wiki in $allwikilist)
#set($ok = $allwikinamelist.add($wiki.substring(17).toLowerCase()))
#end
#if(!$allwikinamelist.contains($context.mainWikiName))
#set($ok = $allwikinamelist.add($context.mainWikiName))
#end
#end
## ---------------
## Wikis macros
## ---------------
#macro(wikinamesoption $wikiname $wikinamelist)
<option value="$wikiname"
#if($wikinamelist.contains($wikiname))selected="selected"#end>$wikiname</option>
#end
#macro(wikinamesselect $allwikinamelist $wikinamelist)
<select name="wikinames">
<option value="" selected="selected">All</option>
#foreach($wikiname in $allwikinamelist)
#wikinamesoption($wikiname $wikinamelist)
#end
</select>
#end
#else
#if($wikinames == "")
#set($wikinames = $context.mainWikiName)
#end
#end
## ---------------
## Query preparation
## ---------------
#set($text = "$!request.getParameter('text')")
#set($query = $text)
#set($utext = $util.encodeURI($query))
#set($defaultItemsPerPage = 30)
#set($itemsPerPage = $util.parseInt("$!{request.perPage}"))
#if($itemsPerPage <= 0)
#set($itemsPerPage = $defaultItemsPerPage)
#end
## ---------------
## Query form
## ---------------
#if(!$rssmode)
{{html}}
<form action="" method="get" id="searchBar">
<div class="centered">
<input type="text" name="text" class="searchQuery
#if($text == '') defaultText#end" #if($text == '')
value="$msg.get('xe.search.bar.query.tip')" #else
value="$xwiki.getXMLEncoded(${text})" #end
title="$msg.get('xe.search.bar.query.title')"/>
#spaceselect($selectedSpace $spaces)
<input type="submit" class="searchButton"
value="$msg.get('xe.search.bar.submit')"
title="$msg.get('xe.search.bar.submit.title')"/>
<div
class="searchHelp">$msg.get('xe.search.bar.queryTip')</div>
</div>
</form>
{{/html}}
#end
## ---------------
## Results processing
## ---------------
#if($query != '')
#set($lucene = $xwiki.getPlugin("lucene"))
#if($lucene)
## ---------------
## Lucene search
## ---------------
#set($searchresults = $lucene.getSearchResults("${query}${extraClause}",
$wikinames, $!languages, $xwiki))
#if($searchresults.getHitcount() > 0)
## -----------------
## Pagination (top)
## -----------------
#if(!$rssmode)
#set($paginationParameters = {'url' : $doc.getURL('view',
"text=${query}&space=${selectedSpace}"), 'totalItems' :
$searchresults.getHitcount(), 'defaultItemsPerPage' : $defaultItemsPerPage,
'position': 'top'})
{{html}}
#pagination($paginationParameters)
{{/html}}
#end
## -----------------
## Display results
## -----------------
#set($firstIndex = "$!{paginationParameters.firstItem}")
#if($firstIndex == '')
#set($firstIndex = "$!request.getParameter('firstIndex')")
#if($firstIndex == '')
#set($firstIndex = '0')
#end
#end
#set($firstIndex = $util.parseInt($firstIndex))
#set($firstIndex = $firstIndex + 1)
#set($results = $searchresults.getResults("$firstIndex",
"$itemsPerPage"))
#if ($rssmode)
#set ($list = $util.arrayList)
#foreach ($item in $results)
#if ($item.type != "attachment")
#set ($ok = $list.add(0, "${item.web}.${item.name}"))
#end
#end
#set ($feed = $xwiki.feed.getDocumentFeed($list, $util.getHashMap()))
#set ($feedURI = $doc.getExternalURL("view"))
#set ($discard = $feed.setLink($feedURI))
#set ($discard = $feed.setUri($feedURI))
#set ($discard = $feed.setAuthor('XWiki'))
#set ($discard = $feed.setTitle($msg.get('xe.search.rss', [$text])))
#set ($discard = $feed.setDescription($msg.get('xe.search.rss',
[$text])))
#set ($discard = $feed.setLanguage($context.language))
#set ($discard =
$feed.setCopyright($xwiki.getXWikiPreference('copyright')))
$xwiki.feed.getFeedOutput($feed, 'rss_2.0')
#else
#set ($list = $results)
#set ($isScored = true)
{{include document="XWiki.Results"/}}
#end
## -----------------
## Pagination (bottom)
## -----------------
#if(!$rssmode)
#set($paginationParameters.position = 'bottom')
{{html}}
#pagination($paginationParameters)
{{/html}}
## ---------------
## RSS link
## ---------------
#if($selectedSpace == '')
#set($rssURL = $xwiki.getURL($doc.fullName, 'view',
"xpage=rdf&text=${utext}" ))
#else
#set($rssURL = $xwiki.getURL($doc.fullName, 'view',
"xpage=rdf&space=${selectedSpace}&text=${utext}"))
#end
{{html}}
<a href="${rssURL}"><img
src="$xwiki.getSkinFile("icons/silk/feed.gif")" alt="RSS
icon"/>$msg.get("xe.search.rss", ["[$query]"])</a>
{{/html}}
#end
#end
#else
{{error}}$msg.get('xe.search.plugin.notfound')){{/error}}
#end
#end
#if (!$rssmode)
## ---------------
## Rebuild processing
## ---------------
#set($lucene = $xwiki.getPlugin("lucene"))
#if($lucene)
#set($doRebuild = "$!{request.getParameter('rebuild')}")
#if($doRebuild == "yes")
#set($documentCount = $lucene.rebuildIndex())
#if(${documentCount} >= 0)
{{info}}$msg.get("xe.search.rebuild.started"){{/info}}
#elseif(${documentCount} == -1)
{{error}}$msg.get("xe.search.rebuild.rights"){{/error}}
#elseif(${documentCount} == -2)
{{error}}$msg.get("xe.search.rebuild.inprogress"){{/error}}
#else
{{error}}$msg.get("xe.search.rebuild.failed"){{/error}}
#end
#else## !doRebuild
## ---------------
## Queue & rebuild option
## ---------------
#set ($queuesize = $xwiki.lucene.getQueueSize())
#if ($queuesize > 2)
#set($info1 = $msg.get('xe.search.rebuild.currently', [${queuesize}]))
#else
#set($info1 = $msg.get('xe.search.index.uptodate'))
#end
#if($hasAdmin)
#set($info2 = "
[[$msg.get('xe.search.index.rebuild')>>${doc.space}.${doc.name}?rebuild=yes]].")
#else
#set($info2 = "")
#end
{{info}}${info1}${info2}{{/info}}
#end## doRebuild
#set($defaultSearch =
"[[$msg.get('xe.search.default.engine')>>WebSearch?text=$utext]]")
{{warning}}$msg.get('xe.search.lucene.experimental',
[$defaultSearch]){{/warning}}
#else## !lucene exists
#set($defaultSearch =
"[[$msg.get('xe.search.default.engine')>>WebSearch?text=$utext]]")
{{warning}}$msg.get('xe.search.plugin.notenabled',
[$defaultSearch]){{/warning}}
#end## lucene exists
#end## !$rssmode]
at
org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluate(VelocityMacro.java:118)
at
org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluate(VelocityMacro.java:44)
at
org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:200)
at
org.xwiki.rendering.macro.script.AbstractScriptMacro.execute(AbstractScriptMacro.java:52)
at
org.xwiki.rendering.internal.transformation.MacroTransformation.transformOnce(MacroTransformation.java:175)
at
org.xwiki.rendering.internal.transformation.MacroTransformation.transform(MacroTransformation.java:120)
at
org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:72)
at com.xpn.xwiki.doc.XWikiDocument.performSyntaxConversion(XWikiDocument.java:5696)
at com.xpn.xwiki.doc.XWikiDocument.performSyntaxConversion(XWikiDocument.java:5671)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:569)
at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:583)
at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:475)
at sun.reflect.GeneratedMethodAccessor257.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:493)
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:336)
at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:191)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:156)
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:116)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1710)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1631)
at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:657)
at sun.reflect.GeneratedMethodAccessor109.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:332)
at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72)
at
org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:212)
at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:247)
at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
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:336)
at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:191)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:156)
at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:116)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1710)
at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1631)
at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:123)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:224)
at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:152)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:117)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.xpn.xwiki.web.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:295)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.xwiki.velocity.XWikiVelocityException: Failed to evaluate content with id
[velocity macro]
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:200)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:156)
at
org.xwiki.rendering.internal.macro.velocity.VelocityMacro.evaluate(VelocityMacro.java:110)
... 93 more
Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method
'getQueueSize' in class com.xpn.xwiki.plugin.lucene.LucenePluginApi threw
exception java.lang.NullPointerException at velocity macro[line 246, column 34]
at
org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:337)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:284)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:252)
at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:493)
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:336)
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.ASTIfStatement.render(ASTIfStatement.java:87)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at
org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:191)
... 95 more
Caused by: java.lang.NullPointerException
at com.xpn.xwiki.plugin.lucene.LucenePlugin.getQueueSize(LucenePlugin.java:661)
at com.xpn.xwiki.plugin.lucene.LucenePluginApi.getQueueSize(LucenePluginApi.java:183)
at sun.reflect.GeneratedMethodAccessor370.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
at
org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
... 108 more