You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Clemens Wyss <cl...@mysign.ch> on 2011/10/24 16:46:54 UTC

AlreadySetException ?

I am seeing this stack trace in my logs:
org.apache.lucene.util.SetOnce$AlreadySetException: The object cannot be set twice!
	at org.apache.lucene.util.SetOnce.set(SetOnce.java:69)
	at org.apache.lucene.index.MergePolicy.setIndexWriter(MergePolicy.java:271)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1104)
	...
What can possibly cause this exception? I can't be calling the constructor of IndexWriter twice, can I ;)

Any help appreciated
- Clemens


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


AW: AlreadySetException ?

Posted by Clemens Wyss <cl...@mysign.ch>.
Simon & Uwe,
thanks a lot!
- Clemens

> -----Ursprüngliche Nachricht-----
> Von: Simon Willnauer [mailto:simon.willnauer@googlemail.com]
> Gesendet: Montag, 24. Oktober 2011 19:35
> An: java-user@lucene.apache.org
> Betreff: Re: AlreadySetException ?
> 
> Clone won't help here, you need to create your MergePolicy again even if
> you clone since MP is not cloneable etc.
> 
> simon
> 
> On Mon, Oct 24, 2011 at 5:08 PM, Uwe Schindler <uw...@thetaphi.de> wrote:
> > Hi,
> >
> > You cannot use the same IndexWriterConfig for two different
> IndexWriters.
> > Clone it before, if you want to use it multiple times.
> >
> > Uwe
> >
> > -----
> > Uwe Schindler
> > H.-H.-Meier-Allee 63, D-28213 Bremen
> > http://www.thetaphi.de
> > eMail: uwe@thetaphi.de
> >
> >
> >> -----Original Message-----
> >> From: Clemens Wyss [mailto:clemensdev@mysign.ch]
> >> Sent: Monday, October 24, 2011 4:47 PM
> >> To: java-user@lucene.apache.org
> >> Subject: AlreadySetException ?
> >>
> >> I am seeing this stack trace in my logs:
> >> org.apache.lucene.util.SetOnce$AlreadySetException: The object cannot
> >> be
> > set
> >> twice!
> >>       at org.apache.lucene.util.SetOnce.set(SetOnce.java:69)
> >>       at
> >> org.apache.lucene.index.MergePolicy.setIndexWriter(MergePolicy.java:2
> >> 71)
> >>       at
> >> org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1104)
> >>       ...
> >> What can possibly cause this exception? I can't be calling the
> >> constructor
> > of
> >> IndexWriter twice, can I ;)
> >>
> >> Any help appreciated
> >> - Clemens
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


Re: AlreadySetException ?

Posted by Simon Willnauer <si...@googlemail.com>.
Clone won't help here, you need to create your MergePolicy again even
if you clone since MP is not cloneable etc.

simon

On Mon, Oct 24, 2011 at 5:08 PM, Uwe Schindler <uw...@thetaphi.de> wrote:
> Hi,
>
> You cannot use the same IndexWriterConfig for two different IndexWriters.
> Clone it before, if you want to use it multiple times.
>
> Uwe
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
>
>> -----Original Message-----
>> From: Clemens Wyss [mailto:clemensdev@mysign.ch]
>> Sent: Monday, October 24, 2011 4:47 PM
>> To: java-user@lucene.apache.org
>> Subject: AlreadySetException ?
>>
>> I am seeing this stack trace in my logs:
>> org.apache.lucene.util.SetOnce$AlreadySetException: The object cannot be
> set
>> twice!
>>       at org.apache.lucene.util.SetOnce.set(SetOnce.java:69)
>>       at
>> org.apache.lucene.index.MergePolicy.setIndexWriter(MergePolicy.java:271)
>>       at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1104)
>>       ...
>> What can possibly cause this exception? I can't be calling the constructor
> of
>> IndexWriter twice, can I ;)
>>
>> Any help appreciated
>> - Clemens
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


RE: AlreadySetException ?

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

You cannot use the same IndexWriterConfig for two different IndexWriters.
Clone it before, if you want to use it multiple times.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Clemens Wyss [mailto:clemensdev@mysign.ch]
> Sent: Monday, October 24, 2011 4:47 PM
> To: java-user@lucene.apache.org
> Subject: AlreadySetException ?
> 
> I am seeing this stack trace in my logs:
> org.apache.lucene.util.SetOnce$AlreadySetException: The object cannot be
set
> twice!
> 	at org.apache.lucene.util.SetOnce.set(SetOnce.java:69)
> 	at
> org.apache.lucene.index.MergePolicy.setIndexWriter(MergePolicy.java:271)
> 	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1104)
> 	...
> What can possibly cause this exception? I can't be calling the constructor
of
> IndexWriter twice, can I ;)
> 
> Any help appreciated
> - Clemens
> 
> 
> ---------------------------------------------------------------------
> 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


AW: AlreadySetException ?

Posted by Clemens Wyss <cl...@mysign.ch>.
>Chuck Norris
... with his swiss army knife ... ;)

Greetings from Switzerland
- Clemens-having-a-swiss-army-knife-too

> -----Ursprüngliche Nachricht-----
> Von: Dawid Weiss [mailto:dawid.weiss@gmail.com]
> Gesendet: Montag, 24. Oktober 2011 17:01
> An: java-user@lucene.apache.org
> Betreff: Re: AlreadySetException ?
> 
> > What can possibly cause this exception? I can't be calling the constructor of
> IndexWriter twice, can I ;)
> 
> I beet Chuck Norris can do that! :)
> 
> Dawid
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org


Re: AlreadySetException ?

Posted by Dawid Weiss <da...@gmail.com>.
> What can possibly cause this exception? I can't be calling the constructor of IndexWriter twice, can I ;)

I beet Chuck Norris can do that! :)

Dawid

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org