lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Chan" <wayofdra...@gmail.com>
Subject Re: ClassCastException when writing to index writer
Date Fri, 03 Oct 2008 20:41:23 GMT
I think I know what the problem is looking at the code:

In SegmentInfos.java (line 321):

class SegmentInfos extends Vector
{
    public Object clone() {
       SegmentInfos sis = (SegmentInfos) super.clone();
       for(int i=0;i<sis.size();i++) {
         sis.setElementAt(((SegmentInfo) sis.elementAt(i)).clone(), i);
       }
       return sis;
    }
}

We see that it is trying to cast a Vector into SegmentInfos which explains
the ClassCastException.  This is definitely a bug.


On Fri, Oct 3, 2008 at 3:40 PM, Paul Chan <wayofdragon@gmail.com> wrote:

> Hi,
>
> I am using lucene 2.3.2 and I encounter the following exception when I try
> to insert a object into the index.
>
> Caused by: java.lang.ClassCastException: java.util.Vector cannot be cast to
> org.apache.lucene.index.SegmentInfos
> at org.apache.lucene.index.SegmentInfos.clone(SegmentInfos.java:321)
> at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:715)
> at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:666)
>
> Has Anyone seen this problem before?  What seems to be the problem?
>
> Thanks!
>

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