org.xwiki.query.QueryException: Exception while execute query. Query statement = [from VisitStats as obj where obj.cookie=:fieldValue and obj.endDate > :date order by obj.endDate desc]

XWiki.org JIRA | Rudolf Tronicek | 8 years ago
  1. 0

    There is a problem with field XWV_COOKIE in table XWIKISTATSVISIT. It throws an exception about "inconsistent datatypes" - see error stack below. I've found JIRA:XASTATS-12 in UNRESOLVED state, so it's an already reported problem. Maybe someone can still take a look... The original field-type in database is CLOB. In xwiki.hdm.xml (xwiki-core-1.8.jar) the field is declared as: <property name="cookie" type="string"> <column name="XWV_COOKIE" not-null="true" length="8192"/> </property> Workaround: I've dropped the field and recreated it as VARCHAR(2000) in database. The exception is gone - but i don't have the knowledge in hibernate or the application to contribute to the problem solution. Error Stack: 11:58:03,601 WARN [JDBCExceptionReporter] SQL Error: 932, SQLState: 42000 11:58:03,601 ERROR [JDBCExceptionReporter] ORA-00932: inconsistent datatypes: expected - got CLOB 11:58:03,601 ERROR [StatsUtil] Failed to search visit object in the database from cookie org.xwiki.query.QueryException: Exception while execute query. Query statement = [from VisitStats as obj where obj.cookie=:fieldValue and obj.endDate > :date order by obj.endDate desc] at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.execute(HqlQueryExecutor.java:93) at org.xwiki.query.internal.DefaultQueryExecutorManager.execute(DefaultQueryExecutorManager.java:56) at org.xwiki.query.internal.DefaultQuery.execute(DefaultQuery.java:230) at com.xpn.xwiki.stats.impl.StatsUtil.findVisitByField(StatsUtil.java:526) at com.xpn.xwiki.stats.impl.StatsUtil.findVisitByCookie(StatsUtil.java:551) at com.xpn.xwiki.stats.impl.StatsUtil.findVisitByCookieOrIPUA(StatsUtil.java:385) at com.xpn.xwiki.stats.impl.StatsUtil.findVisit(StatsUtil.java:330) at com.xpn.xwiki.stats.impl.xwiki.XWikiStatsStoreService.addStats(XWikiStatsStoreService.java:195) at com.xpn.xwiki.stats.impl.XWikiStatsServiceImpl.notify(XWikiStatsServiceImpl.java:147) at com.xpn.xwiki.notify.XWikiActionRule.verify(XWikiActionRule.java:62) at com.xpn.xwiki.notify.XWikiNotificationManager.verify(XWikiNotificationManager.java:245) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:311) 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: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.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:145) 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:111) 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) ...

    XWiki.org JIRA | 8 years ago | Rudolf Tronicek
    org.xwiki.query.QueryException: Exception while execute query. Query statement = [from VisitStats as obj where obj.cookie=:fieldValue and obj.endDate > :date order by obj.endDate desc]
  2. 0

    I noticed that I get some error logging when starting Tomcat. {noformat} 2011-02-21 10:46:06,385 [http://de-s-0xxxxxx.de.abb.com/bin/view/Sandbox/lalala] INFO .AbstractXWikiMigrationManager - No storage migration required since current version is [15429] 2011-02-21 10:46:20,026 [http://de-s-0xxxxxx.de.abb.com/bin/view/Sandbox/lalala] WARN util.JDBCExceptionReporter - SQL Error: 402, SQLState: S0001 2011-02-21 10:46:20,026 [http://de-s-0xxxxxx.de.abb.com/bin/view/Sandbox/lalala] ERROR util.JDBCExceptionReporter - The data types text and nvarchar(max) are incompatible in the equal to operator. 2011-02-21 10:46:20,029 [http://de-s-0xxxxxx.de.abb.com/bin/view/Sandbox/lalala] ERROR impl.StatsUtil - Failed to search visit object in the database from cookie org.xwiki.query.QueryException: Exception while execute query. Query statement = [from VisitStats as obj where obj.cookie=:fieldValue and obj.endDate > :date order by obj.endDate desc] at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.execute(HqlQueryExecutor.java:99) at org.xwiki.query.internal.DefaultQueryExecutorManager.execute(DefaultQueryExecutorManager.java:65) at org.xwiki.query.internal.DefaultQuery.execute(DefaultQuery.java:236) at com.xpn.xwiki.stats.impl.StatsUtil.findVisitByField(StatsUtil.java:581) at com.xpn.xwiki.stats.impl.StatsUtil.findVisitByCookie(StatsUtil.java:606) at com.xpn.xwiki.stats.impl.StatsUtil.findVisitByCookieOrIPUA(StatsUtil.java:441) at com.xpn.xwiki.stats.impl.StatsUtil.findVisit(StatsUtil.java:385) at com.xpn.xwiki.stats.impl.xwiki.XWikiStatsStoreService.addStats(XWikiStatsStoreService.java:198) at com.xpn.xwiki.stats.impl.XWikiStatsServiceImpl.onEvent(XWikiStatsServiceImpl.java:202) at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:278) at org.xwiki.observation.internal.DefaultObservationManager.notify(DefaultObservationManager.java:247) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:316) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:117) 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:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:129) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:152) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:218) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:112) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:244) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: com.xpn.xwiki.XWikiException: Error number 0 in 3: Exception while hibernate execute Wrapped Exception: could not execute query at com.xpn.xwiki.store.XWikiHibernateBaseStore.execute(XWikiHibernateBaseStore.java:1087) at com.xpn.xwiki.store.XWikiHibernateBaseStore.executeRead(XWikiHibernateBaseStore.java:1117) at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.execute(HqlQueryExecutor.java:88) ... 49 more {noformat} Note that I just set up the instance. In order to do that I exported the entire wiki from it's temporary installation which was also Tomcat but along with postgreSQL 9. I used the large import snippet from the extensions wiki to import the large .xar into the new instance.

    XWiki.org JIRA | 6 years ago | Johannes Stoldt
    org.xwiki.query.QueryException: Exception while execute query. Query statement = [from VisitStats as obj where obj.cookie=:fieldValue and obj.endDate > :date order by obj.endDate desc]

    Root Cause Analysis

    1. org.xwiki.query.QueryException

      Exception while execute query. Query statement = [from VisitStats as obj where obj.cookie=:fieldValue and obj.endDate > :date order by obj.endDate desc]

      at com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.execute()
    2. com.xpn.xwiki
      HqlQueryExecutor.execute
      1. com.xpn.xwiki.store.hibernate.query.HqlQueryExecutor.execute(HqlQueryExecutor.java:93)
      1 frame
    3. org.xwiki.query
      DefaultQuery.execute
      1. org.xwiki.query.internal.DefaultQueryExecutorManager.execute(DefaultQueryExecutorManager.java:56)
      2. org.xwiki.query.internal.DefaultQuery.execute(DefaultQuery.java:230)
      2 frames
    4. com.xpn.xwiki
      XWikiAction.execute
      1. com.xpn.xwiki.stats.impl.StatsUtil.findVisitByField(StatsUtil.java:526)
      2. com.xpn.xwiki.stats.impl.StatsUtil.findVisitByCookie(StatsUtil.java:551)
      3. com.xpn.xwiki.stats.impl.StatsUtil.findVisitByCookieOrIPUA(StatsUtil.java:385)
      4. com.xpn.xwiki.stats.impl.StatsUtil.findVisit(StatsUtil.java:330)
      5. com.xpn.xwiki.stats.impl.xwiki.XWikiStatsStoreService.addStats(XWikiStatsStoreService.java:195)
      6. com.xpn.xwiki.stats.impl.XWikiStatsServiceImpl.notify(XWikiStatsServiceImpl.java:147)
      7. com.xpn.xwiki.notify.XWikiActionRule.verify(XWikiActionRule.java:62)
      8. com.xpn.xwiki.notify.XWikiNotificationManager.verify(XWikiNotificationManager.java:245)
      9. com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:311)
      10. com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:115)
      10 frames
    5. struts
      ActionServlet.doGet
      1. org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      2. org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      3. org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      4. org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
      4 frames
    6. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      2. javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      2 frames
    7. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    8. com.xpn.xwiki
      ConversionFilter.doFilter
      1. com.xpn.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:145)
      1 frame
    9. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    10. com.xpn.xwiki
      ActionFilter.doFilter
      1. com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:111)
      1 frame
    11. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    12. com.xpn.xwiki
      XWikiDavFilter.doFilter
      1. com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:68)
      1 frame