1 Reply Latest reply on Nov 4, 2013 2:37 AM by hchiorean

    JCR Date range search query- java.lang.NullPointerException

    fazileh

      Hi, I have a date property in my nodes, and I want to query for nodes that are in a specified range.

      I searched in google and I followed the case according this question: http://stackoverflow.com/questions/15117075/jcr-sql2-query-comparing-dates

      But, my query is a subquery:

       

      SELECT * FROM [nt:unstructured] as e  WHERE Path(e) like '/documents/emails/%' and name(e) IN (SELECT r.[jcr:name] FROM [nt:unstructured] as r where Path(r) like '/users/user1/receive/%')

      and e.date >= CAST('2013-10-21T00:00:00.000' AS DATE) and e.date <= CAST('2013-10-23T00:00:00.000' AS DATE)

       

      my property's node is Date type and has a value like this: date=2013-10-20T14:48:00.000+03:30

       

      When I execute the query I get this exception:

       

      java.lang.NullPointerException

          at org.modeshape.jcr.query.lucene.basic.BasicLuceneQueryFactory.findNodesWithNumericRange(BasicLuceneQueryFactory.java:719)

          at org.modeshape.jcr.query.lucene.basic.BasicLuceneQueryFactory.findNodesWithNumericRange(BasicLuceneQueryFactory.java:699)

          at org.modeshape.jcr.query.lucene.LuceneQueryFactory.createQuery(LuceneQueryFactory.java:420)

          at org.modeshape.jcr.query.lucene.LuceneQueryFactory.createQuery(LuceneQueryFactory.java:206)

          at org.modeshape.jcr.query.lucene.basic.BasicLuceneSchema.createQuery(BasicLuceneSchema.java:513)

          at org.modeshape.jcr.query.lucene.LuceneQueryEngine$LuceneAccessQuery.execute(LuceneQueryEngine.java:282)

          at org.modeshape.jcr.query.process.DependentQueryComponent.execute(DependentQueryComponent.java:101)

          at org.modeshape.jcr.query.process.QueryProcessor.execute(QueryProcessor.java:100)

          at org.modeshape.jcr.query.process.QueryEngine.execute(QueryEngine.java:140)

          at org.modeshape.jcr.query.lucene.LuceneQueryEngine$1.getResults(LuceneQueryEngine.java:166)

          at org.modeshape.jcr.query.JcrQuery.execute(JcrQuery.java:123)

          at org.modeshape.jcr.query.JcrQuery.execute(JcrQuery.java:52)

       

      I'm using Modeshape 3.6.0

      Thanks in advance.