Errors on gradle build using elasticsearch.esplugin

I'm working on moving a plugin to use gradle the the elasticsearch.esplugin gradle plugin, and have a few issues while getting the import done.

  1. Running tests via AnalysisFactoryTestCase fails with the following:
   > Throwable #1: java.lang.IllegalArgumentException: A SPI class of type org.apache.lucene.analysis.util.TokenizerFactory with name 'hebrew' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath. The current classpath supports the following names: [keyword, letter, lowercase, whitespace, edgengram, ngram, pathhierarchy, pattern, simplepatternsplit, simplepattern, classic, standard, uax29urlemail, thai, wikipedia]
   >    at __randomizedtesting.SeedInfo.seed([7DFF65EA60B49884:6DA8CD1B875C5B5B]:0)
   >    at org.apache.lucene.analysis.util.AnalysisSPILoader.lookupClass(AnalysisSPILoader.java:125)
   >    at org.apache.lucene.analysis.util.TokenizerFactory.lookupClass(TokenizerFactory.java:43)
   >    at org.elasticsearch.AnalysisFactoryTestCase.testMultiTermAware(AnalysisFactoryTestCase.java:386)

The plugin works perfect in production, so this seems like a missing configuration on the tests level - but I'm not sure which?

  1. Running gradle build, task test fails with the following error that seems to be out of my control:
Exception thrown by subscriber method onHeartbeat(com.carrotsearch.ant.tasks.junit4.events.aggregated.HeartBeatEvent) on subscriber com.carrotsearch.gradle.junit4.TestReportLogger@7157892 when dispatching event: com.carrotsearch.ant.tasks.junit4.events.aggregated.HeartBeatEvent@29c92971
java.lang.NullPointerException
        at com.carrotsearch.ant.tasks.junit4.ForkedJvmInfo.getPidString(ForkedJvmInfo.java:85)
        at com.carrotsearch.ant.tasks.junit4.ForkedJvmInfo$getPidString.call(Unknown Source)
        at com.carrotsearch.gradle.junit4.TestReportLogger.onHeartbeat(TestReportLogger.groovy:116)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:95)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:154)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$1.run(Subscriber.java:80)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:456)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:76)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:119)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:215)
        at com.carrotsearch.ant.tasks.junit4.events.aggregated.AggregatingListener.slowHeartBeat(AggregatingListener.java:76)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:95)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:154)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber$1.run(Subscriber.java:80)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:456)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:76)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:119)
        at com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.eventbus.EventBus.post(EventBus.java:215)
        at com.carrotsearch.ant.tasks.junit4.LocalSlaveStreamHandler$3.run(LocalSlaveStreamHandler.java:149)
  1. Adding a project license for the license headers check doesn't seem to work. I have a call to licenseHeaders { additionalLicense ... } in my build.gradle file but the check still fails so looks like the call to the additionalLicense method isn't making a difference (and I also couldn't find any examples of plugins using it).

The plugin is here: https://github.com/synhershko/elasticsearch-analysis-hebrew

Hoping it's something simple I missed :slight_smile:

Thanks,

Itamar

The heartbeat issue was a test framework issue, fixed here.

How are you using additionalLicense? It takes 3 arguments, a "category name", a more general "family name", and a substring to search for. Also note that additionalLicense simply defines an additional license type. You also need to set it as (or add it to) the approved licenses. For example:

licenseHeaders {
    additionalLicense 'ABC', 'The ABC License', 'ABC 123, you have a license from me'
    approvedLicenses = ['The ABC License']
}

I didn't add it to approvedLicenses, that was it, thanks!

Any idea re the SPI issue with AnalysisFactoryTestCase ?

And are there known issues with Gradle 3 and 4 with the esplugin on ES < 5.4? I'm getting a gradle build error when trying it with 5.0-5.3.

Thanks!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.