javax.jcr.query.InvalidQueryException: Encountered “{“

I was querying the jcr using query builder interface and by mistake supplied the type as NodeType.NT_UNSTRUCTURED in the query builder map. But when i supplied the constant String to QueryBuilder, it fixed the problem.

com.day.cq.search.impl.builder.QueryImpl Could not run xpath query javax.jcr.query.InvalidQueryException: Encountered “{” at line 1, column 54.
Was expecting:
<QNameForItemType> …
for statement: for $v in /jcr:root/home/users/consumers//element(*, {http://www.jcp.org/jcr/nt/1.0}unstructured)[(@userGuid = ‘s3r5E8OLEQ3cMuVqNX’)] return $v
at org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.<init>(XPathQueryBuilder.java:304)
at org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.createQuery(XPathQueryBuilder.java:336)
at org.apache.jackrabbit.spi.commons.query.xpath.QueryBuilder.createQueryTree(QueryBuilder.java:39)
at org.apache.jackrabbit.spi.commons.query.QueryParser.parse(QueryParser.java:57)
at org.apache.jackrabbit.core.query.lucene.QueryImpl.<init>(QueryImpl.java:91)
at org.apache.jackrabbit.core.query.lucene.SearchIndex.createExecutableQuery(SearchIndex.java:722)
at org.apache.jackrabbit.core.query.QueryImpl.init(QueryImpl.java:115)
at org.apache.jackrabbit.core.SearchManager.createQuery(SearchManager.java:243)
at org.apache.jackrabbit.core.query.QueryManagerImpl$QueryFactoryImpl$2.createQuery(QueryManagerImpl.java:222)
at org.apache.jackrabbit.core.query.CompoundQueryFactory.createQuery(CompoundQueryFactory.java:67)
at org.apache.jackrabbit.core.query.QueryManagerImpl$2.perform(QueryManagerImpl.java:95)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s