InvalidQueryException en XPath Query con nombre de nodo numérico

Problema, Pregunta

Recibe la siguiente excepción cuando intenta hacer una consulta xpath que contiene un nodo que tiene un nombre que comienza con un dígito.

Causado por: javax.jcr.query.InvalidQueryException: Error de análisis: los datos no son un RelationQueryNode at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:504) at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80) at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:89) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:551) at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80) at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:89) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:551) at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80) at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:89) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:551) at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80) at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:89) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:551) at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80) at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:89) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:551) at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80) at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:89) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:551) at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80) at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:89) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:551) at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80) at org.apache.jackrabbit.core.query.xpath.SimpleNode.childrenAccept(SimpleNode.java:89) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.createPathQueryNode(XPathQueryBuilder.java:734) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:372) at org.apache.jackrabbit.core.query.xpath.SimpleNode.jjtAccept(SimpleNode.java:80) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.<init>(XPathQueryBuilder.java:297) at org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.createQuery(XPathQueryBuilder.java:331) at org.apache.jackrabbit.core.query.xpath.QueryBuilder.createQueryTree(QueryBuilder.java:39) at org.apache.jackrabbit.core.query.QueryParser.parse(QueryParser.java:57) at org.apache.jackrabbit.core.query.lucene.QueryImpl.<init>(QueryImpl.java:91) at com.day.crx.query.lucene.CRXExecutableQueryImpl.<init>(CRXExecutableQueryImpl.java:64) at com.day.crx.query.lucene.LuceneHandler.createExecutableQuery(LuceneHandler.java:381) at org.apache.jackrabbit.core.query.QueryImpl.init(QueryImpl.java:127) at org.apache.jackrabbit.core.SearchManager.createQuery(SearchManager.java:305) at org.apache.jackrabbit.core.query.QueryManagerImpl.createQuery(QueryManagerImpl.java:94)

Resolución, Respuesta

Utilice este método para codificar el nombre del nodo numérico utilizando el siguiente método: org.apache.jackrabbit.util.ISO9075.encode(name)
o alternativamente utilice JCR SQL en lugar de XPath.

Se aplica a

CRX 1.x

Referencias

 Adobe

Obtén ayuda de forma más rápida y sencilla

¿Nuevo usuario?