jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Strange error
Date Tue, 05 Jul 2005 11:00:07 GMT
Hi Miklos,

Miklos Pocsaji wrote:
> I get a NoSuchElementException running the following code
> QueryResult result = QueryHelper.query(session, qstr.toString(), "xpath");
> NodeIterator ni = result.getNodes();
> while (ni.hasNext())
>     {
>       Node newsitem = ni.nextNode(); // ***
>       // ...
>     }
> Seems like the index is not coherent with the data stored. I am really
> confused by this error, any ideas?

Could you please try to find out what node in the index caused this 
error? I know it might be a bit tricky but it would help a lot to find 
the cause for this error. You should find an error message in the logs 
which states the uuid of the missing node. with this information you 
should be able to find the lucene document in one of the indexes in the 
workspace folder. Using a tool like Luke 
(http://www.getopt.org/luke/luke.jnlp) can help you on this journey ;)

I'm also interested to see, if the error also occurs if you restrict the 
query to only a subtree of the workspace. but maybe you're doing that 

As a short term solution, you can delete the index in the workspace 
folder. The index is recreated on startup if it is missing.

> (Is it possible that unclosed sessions cause this error?)

well, the only situation where you can really force this error to 
happen, is, to delete a node (but not save its parent) and then search 
for something that matches the deleted node. That's because the index is 
based on the persistent view of the workspace, as specified by jsr-170.

Fabrizio Giustina encountered a similar error: 

But we haven't received any feedback whether he had been able to 
reproduce his error with a JUnit test.

Anyway, I created a JIRA issue to keep track of this error:


View raw message