lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sigbjørn Lund Olsen <>
Subject Having some trouble running tests with custom codec
Date Fri, 09 Oct 2015 14:07:48 GMT
As part of my master's thesis I am planning on implementing a custom Lucene
codec for compression experiments.

To get started with my prototype, I've tried following the instructions
here (but using the more recent Lucene 5.3.1):

However, I am having some trouble getting the codec to load when running
Lucene tests.

I've uploaded a minimal project at

Running *mvn package* generates a jar with a file
*META-INF/services/org.apache.lucene.codecs.Codec* containing a single line:


...which is where the codec class resides at. It's just a FilterCodec
subclass that does nothing extra.

Running *ant -Dtestcase=TestSegmentTermDocs -Dtests.codec=HelloCodec -lib
/path/to/hello-1.0.jar* test gives me the following error:

java.lang.IllegalArgumentException: An SPI class of type
org.apache.lucene.codecs.Codec with name 'HelloCodec' does not exist. You
need to add the corresponding JAR file supporting this SPI to your
classpath. The current classpath supports the following names: [SimpleText,
Asserting, CheapBastard, FastCompressingStoredFields,
HighCompressionCompressingStoredFields, DummyCompressingStoredFields,

What might I be doing wrong here? Is there any way to make Lucene's SPI
loader log what it's trying and/or failing to load, and why?
(Be adviced: I have also asked this question on StackOverflow:

Sigbjørn Lund Olsen

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