jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Haycock" <Robert.Hayc...@artificial-solutions.com>
Subject RE: JCR SQL2 query - NullPointerException in DescendantSelfAxisQuery
Date Fri, 23 Nov 2012 10:04:33 GMT
Reason is because I am not writing this query explicitly and the
existing code uses CONTAINS :)

Using '=' does in fact work. It's a shame CONTAINS doesn't work though.

Thanks.

-----Original Message-----
From: oliver.gregory@gmail.com [mailto:oliver.gregory@gmail.com] 
Sent: 22 November 2012 19:21
To: users@jackrabbit.apache.org
Subject: Re: JCR SQL2 query - NullPointerException in
DescendantSelfAxisQuery

Hello Robert,

document.libraryVersion and  document.documentId are properties ? Why
not simply using equality :

SELECT * FROM [nt:xxxxNode] AS document
WHERE ISDESCENDANTNODE(document, '/thexxxxRoot/07cc41fc-a221-
4fd7-8d2b-0cc8a8719b25')
AND document.documentId =  '378d57e4-0036-4537-bdd4-305e62aa9a67'
AND document.libraryVersion = 1

Query Examples here :
http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src
/test/resources/org/apache/jackrabbit/spi/commons/query/sql2/test.sql2.t
xt?view=markup




2012/11/22 Manfred Sattler <ms@tpso.com>

> Have you the right lucene version,3.0.3?
>
>
> Am 22.11.2012 15:42, schrieb Robert Haycock:
>
>  Hi,
>>
>>
>>
>> I was trying to do a JCR SQL2 query...
>>
>>
>>
>> SELECT * FROM [nt:xxxxNode] AS document WHERE 
>> ISDESCENDANTNODE(document,
>> '/thexxxxRoot/07cc41fc-a221-**4fd7-8d2b-0cc8a8719b25') AND ( CONTAINS

>> (document.documentId, '378d57e4-0036-4537-bdd4-**305e62aa9a67') AND 
>> CONTAINS (document.libraryVersion, '1'))
>>
>>
>>
>> ... and got this exception...
>>
>>
>>
>> java.lang.NullPointerException
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**query.lucene.**DescendantSelfAxisQuery$*
>> *
>> Descenda
>> ntSelfAxisScorer.nextDoc(**DescendantSelfAxisQuery.java:**474)
>>
>>                 at org.apache.lucene.search.**
>> Scorer.score(Scorer.java:61)
>>
>>                 at
>> org.apache.lucene.search.**IndexSearcher.search(**IndexSearcher.java:
>> 212)
>>
>>                 at
>> org.apache.lucene.search.**Searcher.search(Searcher.java:**67)
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**query.lucene.**
>> SortedLuceneQueryHits.getHits(**So
>> rtedLuceneQueryHits.java:156)
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**query.lucene.**SortedLuceneQueryHits.<in
>> it>(
>> **Sor
>> tedLuceneQueryHits.java:113)
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**query.lucene.**JackrabbitIndexSearcher.*
>> *
>> evaluate
>> (JackrabbitIndexSearcher.java:**109)
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**query.lucene.**LuceneQueryFactory.execut
>> e(**
>> Lucen
>> eQueryFactory.java:219)
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**query.lucene.join.QueryEngine.**
>> execute(QueryEn
>> gine.java:465)
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**query.lucene.join.QueryEngine.**
>> execute(QueryEn
>> gine.java:126)
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**query.lucene.join.QueryEngine.**
>> execute(QueryEn
>> gine.java:115)
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**query.QueryObjectModelImpl$2.**
>> perform(QueryObj
>> ectModelImpl.java:129)
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**query.QueryObjectModelImpl$2.**
>> perform(QueryObj
>> ectModelImpl.java:124)
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**session.SessionState.perform(**
>> SessionState.jav
>> a:216)
>>
>>                 at
>>
>> org.apache.jackrabbit.core.**query.QueryObjectModelImpl.**
>> execute(QueryObjec
>> tModelImpl.java:123)
>>
>> This happened in 2.4.3 so I tried 2.5.2 and still got it.
>>
>>
>>
>> Is there a workaround?
>>
>>
>>
>> Rob.
>>
>>
>>
>> Ps. Should exceptions be posted to dev or user?
>>
>
>

Mime
View raw message