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 Bernd Fehling <be...@uni-bielefeld.de> on 2012/11/14 13:04:51 UTC

com.sun.jdi.InvocationException occurred invoking method

Hi list,
while walking through the code with debugger (eclipse juno) I get the following:
com.sun.jdi.InvocationException occurred invoking method.
This is while trying to see org.apache.lucene.search.ScoreDoc

So the debugger seams to have a problem with the toString() of ScoreDoc.java
which looks as follows:

  // A convenience method for debugging.
  @Override
  public String toString() {
    return "doc=" + doc + " score=" + score + " shardIndex=" + shardIndex;
  }

I have no problems with toString() from other classes so the solution might be
to first create a String and return the String value?

  // A convenience method for debugging.
  @Override
  public String toString() {
    String s = "doc=" + doc + " score=" + score + " shardIndex=" + shardIndex;
    return s;
  }

Or use a StringBuilder like in org.apache.lucene.search.Sort.toString()?

Any thoughts on this?

Regards
Bernd


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


Re: com.sun.jdi.InvocationException occurred invoking method

Posted by Bernd Fehling <be...@uni-bielefeld.de>.
OK, so the solution will be that ScoreDoc.toString() should return
a local string with "return s;", right?

Regards
Bernd


Am 14.11.2012 13:38, schrieb Uwe Schindler:
> Fields is only used while sorting results against fields.
> 
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
> 
> 
>> -----Original Message-----
>> From: Bernd Fehling [mailto:bernd.fehling@uni-bielefeld.de]
>> Sent: Wednesday, November 14, 2012 1:18 PM
>> To: java-user@lucene.apache.org
>> Subject: Re: com.sun.jdi.InvocationException occurred invoking method
>>
>> While inspecting the content of topDocs.ScoreDoc I see 4 variables:
>> - doc
>> - fields
>> - score
>> - shardIndex
>> But ScoreDoc knows only about 3 (doc, score, shardIndex) is this the
>> problem?
>>
>> Regards
>> Bernd
>>
>>
>>
>> Am 14.11.2012 13:04, schrieb Bernd Fehling:
>>> Hi list,
>>> while walking through the code with debugger (eclipse juno) I get the
>> following:
>>> com.sun.jdi.InvocationException occurred invoking method.
>>> This is while trying to see org.apache.lucene.search.ScoreDoc
>>>
>>> So the debugger seams to have a problem with the toString() of
>>> ScoreDoc.java which looks as follows:
>>>
>>>   // A convenience method for debugging.
>>>   @Override
>>>   public String toString() {
>>>     return "doc=" + doc + " score=" + score + " shardIndex=" + shardIndex;
>>>   }
>>>
>>> I have no problems with toString() from other classes so the solution
>>> might be to first create a String and return the String value?
>>>
>>>   // A convenience method for debugging.
>>>   @Override
>>>   public String toString() {
>>>     String s = "doc=" + doc + " score=" + score + " shardIndex=" + shardIndex;
>>>     return s;
>>>   }
>>>
>>> Or use a StringBuilder like in org.apache.lucene.search.Sort.toString()?
>>>
>>> Any thoughts on this?
>>>
>>> Regards
>>> Bernd
>>

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


RE: com.sun.jdi.InvocationException occurred invoking method

Posted by Uwe Schindler <uw...@thetaphi.de>.
Fields is only used while sorting results against fields.

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


> -----Original Message-----
> From: Bernd Fehling [mailto:bernd.fehling@uni-bielefeld.de]
> Sent: Wednesday, November 14, 2012 1:18 PM
> To: java-user@lucene.apache.org
> Subject: Re: com.sun.jdi.InvocationException occurred invoking method
> 
> While inspecting the content of topDocs.ScoreDoc I see 4 variables:
> - doc
> - fields
> - score
> - shardIndex
> But ScoreDoc knows only about 3 (doc, score, shardIndex) is this the
> problem?
> 
> Regards
> Bernd
> 
> 
> 
> Am 14.11.2012 13:04, schrieb Bernd Fehling:
> > Hi list,
> > while walking through the code with debugger (eclipse juno) I get the
> following:
> > com.sun.jdi.InvocationException occurred invoking method.
> > This is while trying to see org.apache.lucene.search.ScoreDoc
> >
> > So the debugger seams to have a problem with the toString() of
> > ScoreDoc.java which looks as follows:
> >
> >   // A convenience method for debugging.
> >   @Override
> >   public String toString() {
> >     return "doc=" + doc + " score=" + score + " shardIndex=" + shardIndex;
> >   }
> >
> > I have no problems with toString() from other classes so the solution
> > might be to first create a String and return the String value?
> >
> >   // A convenience method for debugging.
> >   @Override
> >   public String toString() {
> >     String s = "doc=" + doc + " score=" + score + " shardIndex=" + shardIndex;
> >     return s;
> >   }
> >
> > Or use a StringBuilder like in org.apache.lucene.search.Sort.toString()?
> >
> > Any thoughts on this?
> >
> > Regards
> > Bernd
> 
> ---------------------------------------------------------------------
> 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: com.sun.jdi.InvocationException occurred invoking method

Posted by Bernd Fehling <be...@uni-bielefeld.de>.
While inspecting the content of topDocs.ScoreDoc I see 4 variables:
- doc
- fields
- score
- shardIndex
But ScoreDoc knows only about 3 (doc, score, shardIndex) is this the problem?

Regards
Bernd



Am 14.11.2012 13:04, schrieb Bernd Fehling:
> Hi list,
> while walking through the code with debugger (eclipse juno) I get the following:
> com.sun.jdi.InvocationException occurred invoking method.
> This is while trying to see org.apache.lucene.search.ScoreDoc
> 
> So the debugger seams to have a problem with the toString() of ScoreDoc.java
> which looks as follows:
> 
>   // A convenience method for debugging.
>   @Override
>   public String toString() {
>     return "doc=" + doc + " score=" + score + " shardIndex=" + shardIndex;
>   }
> 
> I have no problems with toString() from other classes so the solution might be
> to first create a String and return the String value?
> 
>   // A convenience method for debugging.
>   @Override
>   public String toString() {
>     String s = "doc=" + doc + " score=" + score + " shardIndex=" + shardIndex;
>     return s;
>   }
> 
> Or use a StringBuilder like in org.apache.lucene.search.Sort.toString()?
> 
> Any thoughts on this?
> 
> Regards
> Bernd

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


Re: com.sun.jdi.InvocationException occurred invoking method

Posted by Robert Muir <rc...@gmail.com>.
On Wed, Nov 14, 2012 at 5:38 AM, Bernd Fehling
<be...@uni-bielefeld.de> wrote:
>
> AFAIK eclipse is just an ide and using the java debugger, so this is then a java debugger problem?
>
> http://stackoverflow.com/questions/4123628/com-sun-jdi-invocationexception-occurred-invoking-method
>

I have no idea how eclipse's debugger is implemented. But please
report the bug to them.

if their debugger works for 'z = x + y; return z' but not for 'return
x + y', then its broken!

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


Re: com.sun.jdi.InvocationException occurred invoking method

Posted by Bernd Fehling <be...@uni-bielefeld.de>.
Are you sure that this is a bug in eclipse?

When using a local string and then returning the string the error is gone
and the content of the class displayed.

AFAIK eclipse is just an ide and using the java debugger, so this is then a java debugger problem?

http://stackoverflow.com/questions/4123628/com-sun-jdi-invocationexception-occurred-invoking-method

Regards
Bernd


Am 14.11.2012 14:19, schrieb Robert Muir:
> On Wed, Nov 14, 2012 at 4:04 AM, Bernd Fehling
> <be...@uni-bielefeld.de> wrote:
>> Hi list,
>> while walking through the code with debugger (eclipse juno) I get the following:
>> com.sun.jdi.InvocationException occurred invoking method.
>> This is while trying to see org.apache.lucene.search.ScoreDoc
> 
> you should report the bug to eclipse. This is a bug in their debugger,
> not an issue with lucene.
> 

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


Re: com.sun.jdi.InvocationException occurred invoking method

Posted by Robert Muir <rc...@gmail.com>.
On Wed, Nov 14, 2012 at 4:04 AM, Bernd Fehling
<be...@uni-bielefeld.de> wrote:
> Hi list,
> while walking through the code with debugger (eclipse juno) I get the following:
> com.sun.jdi.InvocationException occurred invoking method.
> This is while trying to see org.apache.lucene.search.ScoreDoc

you should report the bug to eclipse. This is a bug in their debugger,
not an issue with lucene.

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