jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michele Meomartino (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1573) Lucene Query Exception: 'attempt to access a deleted document'
Date Tue, 21 Oct 2008 14:03:47 GMT

    [ https://issues.apache.org/jira/browse/JCR-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12641384#action_12641384
] 

Michele Meomartino commented on JCR-1573:
-----------------------------------------

Hi everyone,
I'm having the same problem while searching for nodes with xPath in my Junit4 test case.
In this test I add some node to the repository-tree and then search with this xPath query:

         //catalog/books//*

then, after each test in @After methods, I provide to clean the repository tree and then saving
session.

        @After
	public void tearDownTest() {
		try {
			session.getRootNode().getNode("catalog").remove();
			session.save();
		}
		catch (RepositoryException e) {			
			e.printStackTrace();
		}
	}

The first time, during creation of repository, everything gones ok. But at  the next run i
get this exception

java.lang.IllegalArgumentException: attempt to access a deleted document
	at org.apache.lucene.index.SegmentReader.document(SegmentReader.java:331)
	at org.apache.lucene.index.FilterIndexReader.document(FilterIndexReader.java:130)
	at org.apache.jackrabbit.core.query.lucene.CachingIndexReader.getParent(CachingIndexReader.java:107)
	at org.apache.jackrabbit.core.query.lucene.SharedIndexReader.getParent(SharedIndexReader.java:78)
	at org.apache.jackrabbit.core.query.lucene.ReadOnlyIndexReader.getParent(ReadOnlyIndexReader.java:141)
	at org.apache.jackrabbit.core.query.lucene.CachingMultiIndexReader.getParentDocId(CachingMultiIndexReader.java:112)
	at org.apache.jackrabbit.core.query.lucene.SearchIndex$CombinedIndexReader.getParent(SearchIndex.java:1234)
	at org.apache.jackrabbit.core.query.lucene.DescendantSelfAxisQuery$DescendantSelfAxisScorer.isValid(DescendantSelfAxisQuery.java:347)
	at org.apache.jackrabbit.core.query.lucene.DescendantSelfAxisQuery$DescendantSelfAxisScorer.next(DescendantSelfAxisQuery.java:261)
	at org.apache.lucene.search.Scorer.score(Scorer.java:48)
	at org.apache.jackrabbit.core.query.lucene.ChildAxisQuery$ChildAxisScorer.calculateChildren(ChildAxisQuery.java:317)
	at org.apache.jackrabbit.core.query.lucene.ChildAxisQuery$ChildAxisScorer.next(ChildAxisQuery.java:268)
	at org.apache.lucene.search.Scorer.score(Scorer.java:48)
	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:146)
	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:113)
	at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:74)
	at org.apache.lucene.search.Hits.<init>(Hits.java:53)
	at org.apache.lucene.search.Searcher.search(Searcher.java:46)
	at org.apache.lucene.search.Searcher.search(Searcher.java:38)
	at org.apache.jackrabbit.core.query.lucene.SearchIndex.executeQuery(SearchIndex.java:692)
	at org.apache.jackrabbit.core.query.lucene.QueryResultImpl.executeQuery(QueryResultImpl.java:242)
	at org.apache.jackrabbit.core.query.lucene.QueryResultImpl.getResults(QueryResultImpl.java:290)
	at org.apache.jackrabbit.core.query.lucene.QueryResultImpl.<init>(QueryResultImpl.java:192)
	at org.apache.jackrabbit.core.query.lucene.QueryImpl.execute(QueryImpl.java:138)
	at org.apache.jackrabbit.core.query.QueryImpl.execute(QueryImpl.java:176)

the strange thing is that if i change the xPath query from

        //catalog/books//*

into
 
        //catalog/books//element(*, somePrimaryNodeType)

I don't get this exception anymore. 
Can anyone shed any light on this issue


> Lucene Query Exception: 'attempt to access a deleted document'
> --------------------------------------------------------------
>
>                 Key: JCR-1573
>                 URL: https://issues.apache.org/jira/browse/JCR-1573
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: jackrabbit-core, query
>    Affects Versions: core 1.4.2
>         Environment: Windows XP, PostgreSQL database, Spring, Tomcat 
>            Reporter: David McKitterick
>         Attachments: jackrabbit-repo.xml
>
>
> Hi,
> I am getting an exception when trying to execute a query through the (Spring) JcrTemplate
class....using the following code:
> QueryManager qMgr = session.getWorkspace().getQueryManager();
> QueryResult result = qMgr.createQuery(xpathQuery, Query.XPATH ).execute();
> The exception is thrown at the second line and is as follows:
> [DEBUG] << "[0x9]at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:113)[\n]"
> [DEBUG] << "[0x9]at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:74)[\n]"
> [DEBUG] << "[0x9]at org.apache.lucene.search.Hits.&lt;init>(Hits.java:53)[\n]"
> [DEBUG] << "[0x9]at org.apache.lucene.search.Searcher.search(Searcher.java:46)[\n]"
> [DEBUG] << "[0x9]at org.apache.lucene.search.Searcher.search(Searcher.java:38)[\n]"
> [DEBUG] << "[0x9]at org.apache.jackrabbit.core.query.lucene.SearchIndex.executeQuery(SearchIndex.java:660)[\n]"
> [DEBUG] << "[0x9]at org.apache.jackrabbit.core.query.lucene.QueryResultImpl.executeQuery(QueryResultImpl.java:242)[\n]"
> [DEBUG] << "[0x9]at org.apache.jackrabbit.core.query.lucene.QueryResultImpl.getResults(QueryResultImpl.java:290)[\n]"
> [DEBUG] << "[0x9]at org.apache.jackrabbit.core.query.lucene.QueryResultImpl.&lt;init>(QueryResultImpl.java:192)[\n]"
> [DEBUG] << "[0x9]at org.apache.jackrabbit.core.query.lucene.QueryImpl.execute(QueryImpl.java:138)[\n]"
> [DEBUG] << "[0x9]at org.apache.jackrabbit.core.query.QueryImpl.execute(QueryImpl.java:176)[\n]"
> [DEBUG] << "[0x9]at com.intel.cds.cr.jcr.JcrManager$5.doInJcr(JcrManager.java:363)[\n]"
> [DEBUG] << "[0x9]at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:76)[\n]"
> [DEBUG] << "[0x9]at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:108)[\n]"
> [DEBUG] << "[0x9]... 19 more[\n]"
> [DEBUG] << "</Exception></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>"
> org.apache.axis2.AxisFault: attempt to access a deleted document
> 	at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
> 	at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
> 	at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
> 	at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
> 	at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> My Jackrabbit/Lucene configuration is as follows:
> <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
>         <param name="path" value="${rep.home}/repository/index"/>
>         
>         <param name="useCompoundFile" value="false"/>
>         <param name="mergeFactor" value="5"/>
>         <param name="cacheSize" value="10000"/>
>         <param name="respectDocumentOrder" value="false"/>  
>   </SearchIndex>
> Is this a configuration issue or a bug?
> Thanks,
> David.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message