On Sun, 30 Jun 2013, Michael McCandless wrote:

On Sun, Jun 30, 2013 at 3:20 PM, Andi Vajda <va...@apache.org> wrote:

On Sun, 30 Jun 2013, Michael McCandless wrote:

Hmm I see two test failures, on Linux, Python 2.7.3, Java 1.7.0_07
:

ERROR: testCachingWorks (__main__.CachingWrapperFilterTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
 File "test/test_CachingWrapperFilter.py", line 53, in testCachingWorks
   strongRef = cacher.getDocIdSet(context, context.reader().getLiveDocs())
AttributeError: 'IndexReader' object has no attribute 'getLiveDocs'


and:

ERROR: testPayloadsPos0 (__main__.PositionIncrementTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
 File "test/test_PositionIncrement.py", line 257, in testPayloadsPos0
   pspans = MultiSpansWrapper.wrap(searcher.getTopReaderContext(), snq)
 File "/home/mike/src/pylucene-4.3.1-1/test/MultiSpansWrapper.py",
line 49, in wrap
   return query.getSpans(ctx, ctx.reader().getLiveDocs(), termContexts)
AttributeError: 'IndexReader' object has no attribute 'getLiveDocs'


I can't reproduce this, the tests pass for me.
I suspect there is some differennce in version somewhere.
The clue is the error message:

  AttributeError: 'IndexReader' object has no attribute 'getLiveDocs'
This is correct. What is not is that ctx.reader() is returning an
IndexReader instance. I put a breakpoint at one of the failures and I'm
getting an AtomicReader back from ctx.reader() and that object does have
getLiveDocs() defined. Below is an excerpt of my debugging session:

  yuzu:vajda> _install/bin/python test/test_PositionIncrement.py
 > /Users/vajda/apache/pylucene-4.3.1/test/MultiSpansWrapper.py(50)wrap()
  -> return query.getSpans(ctx, ctx.reader().getLiveDocs(), termContexts)
  (Pdb) p ctx.reader()
  <AtomicReader: _0(4.3.1):C1>
  (Pdb) !from org.apache.lucene.index import IndexReader
  (Pdb) p IndexReader.getLiveDocs
  (Pdb) !from org.apache.lucene.index import AtomicReader
  (Pdb) p AtomicReader.getLiveDocs
  <method 'getLiveDocs' of 'AtomicReader' objects>

I built and tested this release on Mac OS X with Apple's Java 6.
I suspect the different to be either Java 7 or you have an old version of
jcc, maybe ?

  (Pdb) !import lucene
  (Pdb) p lucene.JCC_VERSION
  '2.16'
  (Pdb) p lucene.VERSION
  '4.3.1'

I need to either renew my VMware Fusion license or install VirtualBox to
test on Linux with Java 7.

I tried Oracle's Java 7 on Mac and it was a big pain as it doesn't seem to
blend with the existing Java Frameworks and I kept getting a JRE mismatch
(building jcc with Java 7 but then having Java 6 run it and complain about
 incompatible bytecode formats). I'm sure this can be eventually resolved
but I was short on time.

Can you please confirm that you see the same jcc version in your build ?
If that's the case, then the next thing is for me to try Java 7 again.

I see 2.16 as the JCC_VERSION and 4.3.1 as the VERSION, so that matches.

Also, I went and built with Java 1.6.0_32, and tests now pass.

I'm not sure why java 7 seems to lead to the failures ...

Me neither, but at least I know now how to proceed...

Thank you for checking that this was indeed related to Java 7 !

Andi..

Reply via email to