[xwiki-users] MSSQL & Date problem
Hi, We are using Tomcat 6.0.18, MSSQL 2005 and XWiki 2.4-MILESTONE-1.29254. When we go to the "Stats" page this error is displayed in the log : [XXX/xwiki/bin/view/Stats/Visit] WARN util.JDBCExceptionReporter - SQL Error: 0, SQLState: 22003 [XXX/xwiki/bin/view/Stats/Visit] ERROR util.JDBCExceptionReporter - Only dates between January 1, 1753 and December 31, 9999 are accepted. [XXX/xwiki/bin/view/Stats/Visit] ERROR xwiki.XWikiStatsReader - Faild to search for vist statistics com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select name, sum(pageSaves), sum(pageViews), sum(downloads) from VisitStats where ? <= startDate and endDate < ? group by name order by sum(pageSaves) asc Wrapped Exception: could not execute query at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2292) at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2221) at com.xpn.xwiki.stats.impl.xwiki.XWikiStatsReader.getVisitStatistics(XWikiStatsReader.java:475) at com.xpn.xwiki.stats.impl.XWikiStatsServiceImpl.getVisitStatistics(XWikiStatsServiceImpl.java:248) at com.xpn.xwiki.api.StatsService.getVisitStatistics(StatsService.java:115) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) .... Any way to correct this ? Sébastien. -- View this message in context: http://xwiki.475771.n2.nabble.com/MSSQL-Date-problem-tp5212940p5212940.html Sent from the XWiki- Users mailing list archive at Nabble.com.
Hi Sébastien, On 06/23/2010 03:11 PM, Sébastien Touzet wrote:
Hi,
We are using Tomcat 6.0.18, MSSQL 2005 and XWiki 2.4-MILESTONE-1.29254. When we go to the "Stats" page this error is displayed in the log :
[XXX/xwiki/bin/view/Stats/Visit] WARN util.JDBCExceptionReporter - SQL Error: 0, SQLState: 22003 [XXX/xwiki/bin/view/Stats/Visit] ERROR util.JDBCExceptionReporter - Only dates between January 1, 1753 and December 31, 9999 are accepted. [XXX/xwiki/bin/view/Stats/Visit] ERROR xwiki.XWikiStatsReader - Faild to search for vist statistics com.xpn.xwiki.XWikiException: Error number 3223 in 3: Exception while searching documents with sql select name, sum(pageSaves), sum(pageViews),
sum(downloads) from VisitStats where ?<= startDate and endDate< ? group by
Either the stored start/end dates are invalid or the date parameter is invalid.
name order by sum(pageSaves) asc Wrapped Exception: could not execute query at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2292) at com.xpn.xwiki.store.XWikiHibernateStore.search(XWikiHibernateStore.java:2221) at com.xpn.xwiki.stats.impl.xwiki.XWikiStatsReader.getVisitStatistics(XWikiStatsReader.java:475) at com.xpn.xwiki.stats.impl.XWikiStatsServiceImpl.getVisitStatistics(XWikiStatsServiceImpl.java:248) at com.xpn.xwiki.api.StatsService.getVisitStatistics(StatsService.java:115) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ....
Any way to correct this ?
Can you look at the xwikistatsvisit table to see is the start/end dates are fine? Also, can you edit in-line the Stats.MostActiveContributors panel and check if the $period and $interval parameters that are passed to the getVisitStatistics method are fine. Hope this helps, Marius
Sébastien.
Hi, All the start/end dates seems OK in the table : 23/06/2010 14:27:11 23/06/2010 14:27:11 17/06/2010 16:58:59 17/06/2010 16:58:59 17/06/2010 16:58:59 17/06/2010 16:58:59 17/06/2010 16:58:59 17/06/2010 16:58:59 17/06/2010 09:49:39 17/06/2010 09:49:39 .... The panel contains the initial content : #panelheader($msg.get("xe.statistics.contributors.mostactive")) #if($xwiki.statsService.enabled) #set($period=$xwiki.criteriaService.periodFactory.ALL_TIME) #set($interval=$xwiki.criteriaService.rangeFactory.createHeadRange(5)) #set($stats=$xwiki.statsService.getVisitStatistics('save',$period,$interval)) #if($stats.size() > 0) #printContributorStats($stats) #else #printNoStatisticsData() #end #else #printStatisticsDisabled() #end #panelfooter() #includeMacros("Stats.Macros") All seems fine but it doesn't work and I don't know why ... -- View this message in context: http://xwiki.475771.n2.nabble.com/MSSQL-Date-problem-tp5212940p5213235.html Sent from the XWiki- Users mailing list archive at Nabble.com.
OK, your were right ! The problem came from "criteriaService.periodFactory.ALL_TIME" Replaced by "criteriaService.periodFactory.currentYear" and all works fine now ! Thank's a lot ! (ALL_TIME is too far ago for SQLSERVER !) -- View this message in context: http://xwiki.475771.n2.nabble.com/MSSQL-Date-problem-tp5212940p5213330.html Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (2)
-
Marius Dumitru Florea -
Sébastien Touzet