Hello all
Any help appreciated. The below query runs without issue on 6.1, but throws javax.jcr.query.InvalidQueryException: java.text.ParseException on 6.3.
The cause could not be missing content could it?
Has there been a breaking change in the query builder implementation?
(/jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/specialOffersPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] | /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/specialOffersPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] | /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/eventPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] | /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/eventPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] | /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/promotionPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] | /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/promotionPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))]) order by jcr:content/@startDate converted to SQL-2 Query: select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/specialOffersPage' and [jcr:content/startDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/specialOffersPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ union select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/specialOffersPage' and [jcr:content/startDate] < cast('2017-10-05T00:00:00.000+02:00' as date) and [jcr:content/endDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/specialOffersPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ order by [jcr:content/startDate] union(*)select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/eventPage' and [jcr:content/startDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/eventPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ order by [jcr:content/startDate] union select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/eventPage' and [jcr:content/startDate] < cast('2017-10-05T00:00:00.000+02:00' as date) and [jcr:content/endDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/eventPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ order by [jcr:content/startDate] union select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/promotionPage' and [jcr:content/startDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/promotionPage') and ((jcr:content/@startDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ order by [jcr:content/startDate] union select [jcr:path], [jcr:score], * from [cq:Page] as a where [jcr:content/cq:template] = '/apps/suninternational/templates/promotionPage' and [jcr:content/startDate] < cast('2017-10-05T00:00:00.000+02:00' as date) and [jcr:content/endDate] >= cast('2017-10-05T00:00:00.000+02:00' as date) and isdescendantnode(a, '/content/suninternational') /* xpath: /jcr:root/content/suninternational//element(*, cq:Page)[(jcr:content/@cq:template = '/apps/suninternational/templates/promotionPage') and ((jcr:content/@startDate < xs:dateTime('2017-10-05T00:00:00.000+02:00')) and (jcr:content/@endDate >= xs:dateTime('2017-10-05T00:00:00.000+02:00')))] order by jcr:content/@startDate */ order by [jcr:content/startDate]
Thanks
Solved! Go to Solution.
Hi all
Installing the Cumulative Fix Pack 6.3.0.2 resolved this issues. Without changing the query the problem was resolved.
Thanks
The docs state that XPath is still valid - Query Builder API
Try shortening the xpath query and see if a basic one works.
Views
Replies
Total Likes
I think issue is query is simply too long
Views
Replies
Total Likes
Agree with scott. Can you first make sure if xpath query (more simple one) is working in 6.3 . Once that is sure, just do a trial and error by splitting your query into smaller ones and try one after the other (These are all for debugging and concluding that xpath is working and will fetch the results for your content).
Once the above is made sure working, as scott mentioned check if the very long query is causing a prob or not ?
Views
Replies
Total Likes
Some of the syntaxes could have been changed. I would recommend to break this query to smaller chunks and execute them to identify which is the syntax that has broken in the newer version.
Once we identify that, then we should be able to see how to handle the same in 6.3
Views
Replies
Total Likes
Hi all
Installing the Cumulative Fix Pack 6.3.0.2 resolved this issues. Without changing the query the problem was resolved.
Thanks