Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1536

[JCR Query] java.lang.IllegalArgumentException: The optimizationNanos argument value may not be negative


    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 3.0.0.Beta1
    • 3.0.0.Alpha5
    • JCR, Query
    • None


      We have tried to follow this example http://docs.jboss.org/modeshape/latest/manuals/reference/html/jcr-query-and-search.html with the version 3.0.0.Alpha5. BUT we get this exception :

      java.lang.IllegalArgumentException: The optimizationNanos argument value, -110669015, may not be negative
            at org.modeshape.common.util.CheckArg.isNonNegative(CheckArg.java:225)
            at org.modeshape.jcr.query.QueryResults$Statistics.withOptimizationTime(QueryResults.java:498)
            at org.modeshape.jcr.query.process.QueryEngine.execute(QueryEngine.java:114)
            at org.modeshape.jcr.query.lucene.LuceneQueryEngine.query(LuceneQueryEngine.java:131)
            at org.modeshape.jcr.RepositoryQueryManager.query(RepositoryQueryManager.java:101)
            at org.modeshape.jcr.JcrQueryManager$SessionQueryContext.execute(JcrQueryManager.java:281)Shutting down engine ...
            at org.modeshape.jcr.query.JcrQuery.execute(JcrQuery.java:109)
            at org.modeshape.example.sequencing.TestQueryLanguageJcrSql2.main(TestQueryLanguageJcrSql2.java:113)

      where the calling code is:

      javax.jcr.query.Query query = mgr.createQuery("select * from [nt:unstructured]", Query.JCR_SQL2)
      javax.jcr.query.QueryResult result1 = query.execute();

      The problem is really strange because sometimes our code works fine and get the results sometimes we get this exception... Moreover in 2 different environment it's not the same behaviour (For example in mine (Windows 7) it work everytime but in my colleague's one (Windows XP SP2) sometimes it works sometimes we get the exception as I said before !!)

      So the behaviour is random depending on the environment!

            rhauch Randall Hauch (Inactive)
            badr_jira badr elhouari (Inactive)
            0 Vote for this issue
            2 Start watching this issue