On Fri, 16 Oct 2009, Yura Smolsky wrote:

I have added Java wrapper for Searcher class (see attach) and compiled
pylucene 2.4.1 against Python 2.5.4 (debian Linux 2.6.30-2-amd64)

When I try following program

#!/usr/local/bin/python

from lucene import *
class MySearcher(PythonSearcher):
   def __init__(self):
       super(MySearcher, self).__init__()
if __name__=='__main__':
   initVM(CLASSPATH)
   s = MySearcher()
   parallel = ParallelMultiSearcher([s])

I got this message:

Traceback (most recent call last):
 File "./remote.py", line 13, in <module>
   parallel = ParallelMultiSearcher([s])
lucene.InvalidArgsError: (<type 'ParallelMultiSearcher'>, '__init__',
([<MySearcher: org.apache.pylucene.search.pythonsearc...@19c247a0>],))

What's wrong with my brain? :-)

It's a bug in JCC. The code converting lists of objects had a bug with extension objects, in two places.

With my fix, not yet checked in, your code then fails with a stack overflow as you didn't actually implement any of the methods in MySearcher that you declared native in PythonSearcher.

Because there is no local implementation , the code that calls these methods calls the inherited method instead. That inherited method is the one that calls the local Python implementation which instead calls the inherited method and so on ...

Andi..

Reply via email to