jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ThorstenL <thorsten.lan...@udo.edu>
Subject XPath expression leeds to NPE in QueryParser
Date Wed, 25 Jun 2008 14:21:32 GMT

Hello!

 I'm currently trying with to write my first non trivial queries with XPath.
So I'm not too sure, if I misunderstand something completely wrong, or
if there is something broken.

 This is my current candidates:

//*[@jcr:primaryType='nt:file'][*//text()[jcr:like(.,'%Dokument%')]]

//*[@jcr:primaryType='nt:file' and *//text()[jcr:contains(.,'%Dokument%')]]

I'm looking for any 'files' that contain the String 'Dokument' in any child.
My 'nt:file' elements really have childs, i added content to them by import
and they are saved. 

The queries above create a NPE in the XPathQueryBuilder.

Can you give me a hint, to make this query work?

 Thank you!
  Thorsten


using: JDK6, Jackrabbit1.4.4

java.lang.NullPointerException
	at
org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:426)
	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:535)
	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.createLocationStep(XPathQueryBuilder.java:603)
	at
org.apache.jackrabbit.core.query.xpath.XPathQueryBuilder.visit(XPathQueryBuilder.java:414)
	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
org.apache.jackrabbit.core.query.lucene.SearchIndex.createExecutableQuery(SearchIndex.java:604)
	at org.apache.jackrabbit.core.query.QueryImpl.init(QueryImpl.java:127)
	at
org.apache.jackrabbit.core.SearchManager.createQuery(SearchManager.java:304)
	at
org.apache.jackrabbit.core.query.QueryManagerImpl.createQuery(QueryManagerImpl.java:94)
	at plugins.JCRSupport.ask(JCRSupport.java:48)


-- 
View this message in context: http://www.nabble.com/XPath-expression-leeds-to-NPE-in-QueryParser-tp18113713p18113713.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message