You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Bret Schuhmacher (JIRA)" <ji...@apache.org> on 2012/07/18 17:08:34 UTC

[jira] [Updated] (JCR-3391) Using "as" in an XPath query causes a failure

     [ https://issues.apache.org/jira/browse/JCR-3391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bret Schuhmacher updated JCR-3391:
----------------------------------

          Description: 
Running an XPath query against a path with "as" in it, such as:
/jcr:root/content/dam/imp/campaigns/IN/as/global/hotmail_for_skydrive//*[jcr:content/@sling:resourceType = 'imp/components/offermapping']

The "IN/as" is a locale that we built into our node path.

The error we get is :
16.07.2012 16:51:18.249 *WARN* [127.0.0.1 [1342482674243] POST /bin/imp/campaignPermissions HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl Could not run xpath query javax.jcr.query.InvalidQueryException: Encountered "as" at line 1, column 50.
Was expecting one of:
     <IntegerLiteral> ...
     <DecimalLiteral> ...
     <DoubleLiteral> ...
     <StringLiteral> ...
     "<?" ...
     "<?" ...
     <AxisChild> ...
     <AxisDescendant> ...
     <AxisParent> ...
     <AxisAttribute> ...
     <AxisSelf> ...
     <AxisDescendantOrSelf> ...
     <AxisAncestor> ...
     <AxisFollowingSibling> ...
     <AxisPrecedingSibling> ...
     <AxisFollowing> ...
     <AxisPreceding> ...
     <AxisAncestorOrSelf> ...
     "$" ...
     <ElementType> ...
     <AttributeType> ...
     <SchemaElementType> ...
     <SchemaAttributeType> ...
     <OrderedOpen> ...
     <UnorderedOpen> ...
     <ElementQNameLbrace> ...
     <AttributeQNameLbrace> ...
     <PINCNameLbrace> ...
     <PILbrace> ...
     <CommentLbrace> ...
     <ElementLbrace> ...
     <AttributeLbrace> ...
     <TextLbrace> ...
     "*" ...
     <NCNameColonStar> ...
     <StarColonNCName> ...
     "(" ...
     "@" ...
     <DocumentLpar> ...
     <DocumentLparForKindTest> ...
     <DocumentLbrace> ...
     <NodeLpar> ...
     <CommentLpar> ...
     <TextLpar> ...
     <ProcessingInstructionLpar> ...
     <ElementTypeForKindTest> ...
     <ElementTypeForDocumentTest> ...
     <AttributeTypeForKindTest> ...
     <SchemaElementTypeForKindTest> ...
     <SchemaElementTypeForDocumentTest> ...
     <SchemaAttributeTypeForKindTest> ...
     <ProcessingInstructionLparForKindTest> ...
     <TextLparForKindTest> ...
     <CommentLparForKindTest> ...
     <NodeLparForKindTest> ...
     "." ...
     ".." ...
     <QNameLpar> ...
     "<" ...
     "<" ...
     "<!--" ...
     "<!--" ...
     <QName> ...
      for statement: for $v in /jcr:root/content/dam/imp/campaigns/IN/as/global/hotmail_for_skydrive//*[jcr:content/@sling:resourceType = 'imp/components/offermapping'] return $v
	at org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.<init>(XPathQueryBuilder.java:299)
	at org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.createQuery(XPathQueryBuilder.java:331)
	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:712)
	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)
	at org.apache.jackrabbit.core.query.QueryManagerImpl$2.perform(QueryManagerImpl.java:91)
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
	at org.apache.jackrabbit.core.query.QueryManagerImpl.perform(QueryManagerImpl.java:197)
	at org.apache.jackrabbit.core.query.QueryManagerImpl.createQuery(QueryManagerImpl.java:91)

  was:
There wasn't a version 2.3.15 in the list, but the actual JCR version is 2.3.15.


Running an XPath query against a path with "as" in it, such as:
/jcr:root/content/dam/imp/campaigns/IN/as/global/hotmail_for_skydrive//*[jcr:content/@sling:resourceType = 'imp/components/offermapping']

The "IN/as" is a locale that we built into our node path.

The error we get is :
16.07.2012 16:51:18.249 *WARN* [127.0.0.1 [1342482674243] POST /bin/imp/campaignPermissions HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl Could not run xpath query javax.jcr.query.InvalidQueryException: Encountered "as" at line 1, column 50.
Was expecting one of:
     <IntegerLiteral> ...
     <DecimalLiteral> ...
     <DoubleLiteral> ...
     <StringLiteral> ...
     "<?" ...
     "<?" ...
     <AxisChild> ...
     <AxisDescendant> ...
     <AxisParent> ...
     <AxisAttribute> ...
     <AxisSelf> ...
     <AxisDescendantOrSelf> ...
     <AxisAncestor> ...
     <AxisFollowingSibling> ...
     <AxisPrecedingSibling> ...
     <AxisFollowing> ...
     <AxisPreceding> ...
     <AxisAncestorOrSelf> ...
     "$" ...
     <ElementType> ...
     <AttributeType> ...
     <SchemaElementType> ...
     <SchemaAttributeType> ...
     <OrderedOpen> ...
     <UnorderedOpen> ...
     <ElementQNameLbrace> ...
     <AttributeQNameLbrace> ...
     <PINCNameLbrace> ...
     <PILbrace> ...
     <CommentLbrace> ...
     <ElementLbrace> ...
     <AttributeLbrace> ...
     <TextLbrace> ...
     "*" ...
     <NCNameColonStar> ...
     <StarColonNCName> ...
     "(" ...
     "@" ...
     <DocumentLpar> ...
     <DocumentLparForKindTest> ...
     <DocumentLbrace> ...
     <NodeLpar> ...
     <CommentLpar> ...
     <TextLpar> ...
     <ProcessingInstructionLpar> ...
     <ElementTypeForKindTest> ...
     <ElementTypeForDocumentTest> ...
     <AttributeTypeForKindTest> ...
     <SchemaElementTypeForKindTest> ...
     <SchemaElementTypeForDocumentTest> ...
     <SchemaAttributeTypeForKindTest> ...
     <ProcessingInstructionLparForKindTest> ...
     <TextLparForKindTest> ...
     <CommentLparForKindTest> ...
     <NodeLparForKindTest> ...
     "." ...
     ".." ...
     <QNameLpar> ...
     "<" ...
     "<" ...
     "<!--" ...
     "<!--" ...
     <QName> ...
      for statement: for $v in /jcr:root/content/dam/imp/campaigns/IN/as/global/hotmail_for_skydrive//*[jcr:content/@sling:resourceType = 'imp/components/offermapping'] return $v
	at org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.<init>(XPathQueryBuilder.java:299)
	at org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.createQuery(XPathQueryBuilder.java:331)
	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:712)
	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)
	at org.apache.jackrabbit.core.query.QueryManagerImpl$2.perform(QueryManagerImpl.java:91)
	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
	at org.apache.jackrabbit.core.query.QueryManagerImpl.perform(QueryManagerImpl.java:197)
	at org.apache.jackrabbit.core.query.QueryManagerImpl.createQuery(QueryManagerImpl.java:91)

    Affects Version/s:     (was: 2.3.1)
                       2.4
    
> Using "as" in an XPath query causes a failure
> ---------------------------------------------
>
>                 Key: JCR-3391
>                 URL: https://issues.apache.org/jira/browse/JCR-3391
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-spi-commons
>    Affects Versions: 2.4
>         Environment: Mac OSX 10.6.8, possibly others
>            Reporter: Bret Schuhmacher
>              Labels: xpath
>
> Running an XPath query against a path with "as" in it, such as:
> /jcr:root/content/dam/imp/campaigns/IN/as/global/hotmail_for_skydrive//*[jcr:content/@sling:resourceType = 'imp/components/offermapping']
> The "IN/as" is a locale that we built into our node path.
> The error we get is :
> 16.07.2012 16:51:18.249 *WARN* [127.0.0.1 [1342482674243] POST /bin/imp/campaignPermissions HTTP/1.1] com.day.cq.search.impl.builder.QueryImpl Could not run xpath query javax.jcr.query.InvalidQueryException: Encountered "as" at line 1, column 50.
> Was expecting one of:
>      <IntegerLiteral> ...
>      <DecimalLiteral> ...
>      <DoubleLiteral> ...
>      <StringLiteral> ...
>      "<?" ...
>      "<?" ...
>      <AxisChild> ...
>      <AxisDescendant> ...
>      <AxisParent> ...
>      <AxisAttribute> ...
>      <AxisSelf> ...
>      <AxisDescendantOrSelf> ...
>      <AxisAncestor> ...
>      <AxisFollowingSibling> ...
>      <AxisPrecedingSibling> ...
>      <AxisFollowing> ...
>      <AxisPreceding> ...
>      <AxisAncestorOrSelf> ...
>      "$" ...
>      <ElementType> ...
>      <AttributeType> ...
>      <SchemaElementType> ...
>      <SchemaAttributeType> ...
>      <OrderedOpen> ...
>      <UnorderedOpen> ...
>      <ElementQNameLbrace> ...
>      <AttributeQNameLbrace> ...
>      <PINCNameLbrace> ...
>      <PILbrace> ...
>      <CommentLbrace> ...
>      <ElementLbrace> ...
>      <AttributeLbrace> ...
>      <TextLbrace> ...
>      "*" ...
>      <NCNameColonStar> ...
>      <StarColonNCName> ...
>      "(" ...
>      "@" ...
>      <DocumentLpar> ...
>      <DocumentLparForKindTest> ...
>      <DocumentLbrace> ...
>      <NodeLpar> ...
>      <CommentLpar> ...
>      <TextLpar> ...
>      <ProcessingInstructionLpar> ...
>      <ElementTypeForKindTest> ...
>      <ElementTypeForDocumentTest> ...
>      <AttributeTypeForKindTest> ...
>      <SchemaElementTypeForKindTest> ...
>      <SchemaElementTypeForDocumentTest> ...
>      <SchemaAttributeTypeForKindTest> ...
>      <ProcessingInstructionLparForKindTest> ...
>      <TextLparForKindTest> ...
>      <CommentLparForKindTest> ...
>      <NodeLparForKindTest> ...
>      "." ...
>      ".." ...
>      <QNameLpar> ...
>      "<" ...
>      "<" ...
>      "<!--" ...
>      "<!--" ...
>      <QName> ...
>       for statement: for $v in /jcr:root/content/dam/imp/campaigns/IN/as/global/hotmail_for_skydrive//*[jcr:content/@sling:resourceType = 'imp/components/offermapping'] return $v
> 	at org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.<init>(XPathQueryBuilder.java:299)
> 	at org.apache.jackrabbit.spi.commons.query.xpath.XPathQueryBuilder.createQuery(XPathQueryBuilder.java:331)
> 	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:712)
> 	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)
> 	at org.apache.jackrabbit.core.query.QueryManagerImpl$2.perform(QueryManagerImpl.java:91)
> 	at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
> 	at org.apache.jackrabbit.core.query.QueryManagerImpl.perform(QueryManagerImpl.java:197)
> 	at org.apache.jackrabbit.core.query.QueryManagerImpl.createQuery(QueryManagerImpl.java:91)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira