It looks like Mockito is the culprit here. Code fragment causing error:
final IndexWriter indexWriter = Mockito.spy(new > IndexWriter(FSDirectory.open(new File("")), new > StandardAnalyzer(Version.LUCENE_30), MaxFieldLength.LIMITED)); > indexWriter.addDocument(new Document()); > indexWriter.commit(); > Stack trace: java.lang.AssertionError at org.apache.lucene.index.IndexWriter$ReaderPool.commit(IndexWriter.java:557) at org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:4737) at org.apache.lucene.index.IndexWriter.prepareCommit(IndexWriter.java:3461) at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3534) at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3505) at myTestClass.test(myTestClass.java:10) On Tue, Jan 25, 2011 at 6:37 PM, Michael McCandless < luc...@mikemccandless.com> wrote: > ... and also the full exception? > > Mike > > On Tue, Jan 25, 2011 at 11:52 AM, Uwe Schindler <u...@thetaphi.de> wrote: > > Can you post your code? > > > > ----- > > Uwe Schindler > > H.-H.-Meier-Allee 63, D-28213 Bremen > > http://www.thetaphi.de > > eMail: u...@thetaphi.de > > > > > >> -----Original Message----- > >> From: Anuj Shah [mailto:anujshahw...@gmail.com] > >> Sent: Tuesday, January 25, 2011 5:18 PM > >> To: java-user@lucene.apache.org > >> Subject: AssertionError > >> > >> Hi, > >> > >> I've upgraded from 3.00 to 3.0.3 and am now hitting assertion errors > from > >> IndexWriter.ReaderPool.commit, at this line: > >> > >> // We invoke deleter.checkpoint below, so we must be > >> > // sync'd on IW: > >> > assert Thread.holdsLock(IndexWriter.this); > >> > > >> > >> Has anyone encountered this before? I'm hoping this is a common scenario > >> and there is a quick fix to avoid it. > >> > >> Thanks > >> > >> Anuj > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > > For additional commands, e-mail: java-user-h...@lucene.apache.org > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >