Return-Path: Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: (qmail 33598 invoked from network); 23 Mar 2009 22:14:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Mar 2009 22:14:06 -0000 Received: (qmail 57735 invoked by uid 500); 23 Mar 2009 22:14:05 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 57710 invoked by uid 500); 23 Mar 2009 22:14:05 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 57699 invoked by uid 99); 23 Mar 2009 22:14:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Mar 2009 22:14:05 +0000 X-ASF-Spam-Status: No, hits=-1.8 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [64.18.2.163] (HELO exprod7og105.obsmtp.com) (64.18.2.163) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 23 Mar 2009 22:13:56 +0000 Received: from source ([74.125.46.31]) by exprod7ob105.postini.com ([64.18.6.12]) with SMTP ID DSNKScgJjSiHNqwEuypOMQP0oMvW5lyRnDr2@postini.com; Mon, 23 Mar 2009 15:13:35 PDT Received: by yw-out-2324.google.com with SMTP id 3so4641185ywj.87 for ; Mon, 23 Mar 2009 15:13:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.90.93.8 with SMTP id q8mr4372062agb.111.1237846413103; Mon, 23 Mar 2009 15:13:33 -0700 (PDT) In-Reply-To: <813d89dc0903231302y3db98995n8c266c749b8c6ada@mail.gmail.com> References: <813d89dc0903230848p2bbd0ae6ud1bc4545163cb53a@mail.gmail.com> <813d89dc0903231302y3db98995n8c266c749b8c6ada@mail.gmail.com> Date: Mon, 23 Mar 2009 18:13:32 -0400 Message-ID: <813d89dc0903231513y510cacc6w42f40b8ab3149d1b@mail.gmail.com> Subject: Re: NPE in CachingIndexReader From: Dan Diephouse To: users@jackrabbit.apache.org Content-Type: multipart/alternative; boundary=00163630e87fbd539b0465d0935b X-Virus-Checked: Checked by ClamAV on apache.org --00163630e87fbd539b0465d0935b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit So this error was evidently a bit too obvious for me. I was using an in memory database store yet the index is persistent. Hence on restart the nodes were no longer there, but the index was! On Mon, Mar 23, 2009 at 4:02 PM, Dan Diephouse wrote: > Taking a second look at this, this definitely has something to do with > jackrabbit shutting down. Although I'm not sure what. If I start with a > fresh repository I can repeatedly run my test from my IDE without any > problems. However, when I run the test via maven I get the error below. I > have verified that I am calling shutdown on the repository correctly. > Any ideas about places to look for something that might be corrupting the > index? > Dan > > > On Mon, Mar 23, 2009 at 11:48 AM, Dan Diephouse < > dan.diephouse@mulesource.com> wrote: > >> I'm getting the following exception with 1.4.x: >> java.lang.NullPointerException >> at >> org.apache.jackrabbit.core.query.lucene.CachingIndexReader$CacheInitializer$2.collect(CachingIndexReader.java:362) >> at >> org.apache.jackrabbit.core.query.lucene.CachingIndexReader$CacheInitializer.collectTermDocs(CachingIndexReader.java:426) >> at >> org.apache.jackrabbit.core.query.lucene.CachingIndexReader$CacheInitializer.initializeParents(CachingIndexReader.java:356) >> at >> org.apache.jackrabbit.core.query.lucene.CachingIndexReader$CacheInitializer.run(CachingIndexReader.java:306) >> at >> org.apache.jackrabbit.core.query.lucene.CachingIndexReader.(CachingIndexReader.java:109) >> at >> org.apache.jackrabbit.core.query.lucene.AbstractIndex.getReadOnlyIndexReader(AbstractIndex.java:276) >> at >> org.apache.jackrabbit.core.query.lucene.MultiIndex.getIndexReader(MultiIndex.java:731) >> at >> org.apache.jackrabbit.core.query.lucene.MultiIndex.(MultiIndex.java:303) >> at >> org.apache.jackrabbit.core.query.lucene.SearchIndex.doInit(SearchIndex.java:454) >> at >> org.apache.jackrabbit.core.query.AbstractQueryHandler.init(AbstractQueryHandler.java:53) >> at >> org.apache.jackrabbit.core.SearchManager.initializeQueryHandler(SearchManager.java:583) >> at >> org.apache.jackrabbit.core.SearchManager.(SearchManager.java:265) >> at >> org.apache.jackrabbit.core.RepositoryImpl.getSystemSearchManager(RepositoryImpl.java:625) >> at >> org.apache.jackrabbit.core.RepositoryImpl.access$300(RepositoryImpl.java:104) >> at >> org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.getSearchManager(RepositoryImpl.java:1600) >> at >> org.apache.jackrabbit.core.RepositoryImpl.initWorkspace(RepositoryImpl.java:606) >> at >> org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:415) >> at >> org.apache.jackrabbit.core.RepositoryImpl.(RepositoryImpl.java:305) >> at >> org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:557) >> >> The code is: >> >> collectTermDocs(reader, new Term(FieldNames.PARENT, "0"), new >> TermDocsCollector() { >> public void collect(Term term, TermDocs tDocs) throws >> IOException { >> while (tDocs.next()) { >> UUID uuid = UUID.fromString(term.text()); >> Integer docId = new Integer(tDocs.doc()); >> NodeInfo info = (NodeInfo) docs.get(docId); >> info.parent = uuid; >> docs.remove(docId); >> docs.put(info.uuid, info); >> } >> } >> }); >> >> Correct me if I'm wrong, but it seems to me that the code should not >> assume that there is already a NodeInfo in the docs cache. For instance, if >> a node was added between when we gathered all the UUIDs and when we searched >> the parent IDs, then docs.get(docId) could return null. The whole in that >> explanation though would be that this is happening on initialization and >> there should be anything/anyone adding/removing nodes. >> >> Thoughts? >> >> Dan >> -- >> Dan Diephouse >> http://mulesource.com | http://netzooid.com/blog >> > > > > -- > Dan Diephouse > http://mulesource.com | http://netzooid.com/blog > -- Dan Diephouse http://mulesource.com | http://netzooid.com/blog --00163630e87fbd539b0465d0935b--