lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anuj Shah <anujshahw...@gmail.com>
Subject Re: AssertionError
Date Wed, 26 Jan 2011 12:20:06 GMT
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 <
lucene@mikemccandless.com> wrote:

> ... and also the full exception?
>
> Mike
>
> On Tue, Jan 25, 2011 at 11:52 AM, Uwe Schindler <uwe@thetaphi.de> wrote:
> > Can you post your code?
> >
> > -----
> > Uwe Schindler
> > H.-H.-Meier-Allee 63, D-28213 Bremen
> > http://www.thetaphi.de
> > eMail: uwe@thetaphi.de
> >
> >
> >> -----Original Message-----
> >> From: Anuj Shah [mailto:anujshahwork@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-unsubscribe@lucene.apache.org
> > For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message