Getting these exceptions when I try delete certain documents:
Error number 4001 in 4: Error while parsing velocity page
Wrapped Exception: Invocation of method 'searchDocuments' in  class com.xpn.xwiki.api.XWiki threw exception com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with SQL [select distinct doc.web, doc.name from XWikiDocument as doc where doc.fullName <> ? and (doc.parent = ? or (doc.parent = ? and doc.web = ?))]
Wrapped Exception: could not execute query @ <unknown template>[11,24]
com.xpn.xwiki.XWikiException: Error number 4001 in 4: Error while parsing velocity page
Wrapped Exception: Invocation of method 'searchDocuments' in  class com.xpn.xwiki.api.XWiki threw exception com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with SQL [select distinct doc.web, doc.name from XWikiDocument as doc where doc.fullName <> ? and (doc.parent = ? or (doc.parent = ? and doc.web = ?))]
Wrapped Exception: could not execute query @ <unknown template>[11,24]
        at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:157)
        at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1353)
        at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1314)
        at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:105)
        at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:158)
        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:690)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:117)
        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:175)
        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:263)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Unknown Source)