Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-2064

DBListClass and DBTreeListClass are building invalid SQL statements

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.1, 1.3 M1
    • Fix Version/s: 1.2.2, 1.3 M2
    • Component/s: {Unused} Core
    • Labels:
      None
    • keywords:
      patch
    • Tests:
      Unit
    • Similar issues:

      Description

      Query build in DBListClass and DBTreeListClass is invalid since it contains a "," before the from statement.

      Thus resulting in Exceptions like:

      org.hibernate.hql.ast.QuerySyntaxException: unexpected token: from near line 1, column 35 [select idprop.value,idprop.value, from com.xpn.xwiki.doc.XWikiDocument as doc, com.xpn.xwiki.objects.BaseObject as obj, com.xpn.xwiki.objects.StringProperty as idprop where doc.fullName=obj.name and obj.className='' and obj.id=idprop.id.id and idprop.id.name='']
      at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
      at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
      at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
      at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258)
      at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
      at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
      at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
      at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
      at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
      at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
      at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
      at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
      at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:1699)
      at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:1659)
      at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:1648)
      at com.xpn.xwiki.store.XWikiCacheStore.search(XWikiCacheStore.java:420)
      at com.xpn.xwiki.XWiki.search(XWiki.java:1278)
      at com.xpn.xwiki.objects.classes.DBListClass.getDBList(DBListClass.java:102)
      at com.xpn.xwiki.objects.classes.DBListClass.getMap(DBListClass.java:128)
      at com.xpn.xwiki.objects.classes.DBListClass.displayView(DBListClass.java:445)
      at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1338)
      at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1318)
      at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1385)
      at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1395)
      at com.xpn.xwiki.api.Document.display(Document.java:857)
      at sun.reflect.GeneratedMethodAccessor152.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.invoke(UberspectImpl.java:295)
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245)
      at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
      at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
      at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:448)
      at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:170)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:238)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:152)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.render(XWikiVelocityRenderer.java:95)
      at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:251)
      at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:176)
      at com.xpn.xwiki.XWiki.include(XWiki.java:3206)
      at com.xpn.xwiki.api.XWiki.includeForm(XWiki.java:1409)
      at com.xpn.xwiki.api.XWiki.includeForm(XWiki.java:1375)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      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.invoke(UberspectImpl.java:295)
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245)
      at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
      at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194)
      at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:170)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:238)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:152)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.render(XWikiVelocityRenderer.java:95)
      at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:251)
      at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:176)
      at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:145)
      at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderDocument(DefaultXWikiRenderingEngine.java:134)
      at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:407)
      at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:371)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      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.invoke(UberspectImpl.java:295)
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245)
      at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
      at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:238)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:152)
      at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1366)
      at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1335)
      at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:607)
      at sun.reflect.GeneratedMethodAccessor119.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.invoke(UberspectImpl.java:295)
      at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:245)
      at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
      at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194)
      at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:170)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
      at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:88)
      at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:107)
      at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:238)
      at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:152)
      at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1366)
      at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1335)
      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(Thread.java:619)

        Attachments

          Activity

            People

            • Assignee:
              vmassol Vincent Massol
              Reporter:
              yoshtec Yoshtec
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: