Guice @Inject problems when upgrading plugin to 6.1.0

(Jettro Coenradie) #1

I am working on upgrading the learning to rank plugin from 5.6.x to 6.1.0. I was able to get the code compiling again, running the unit tests works as well. Next step is booting elasticsearch, installing the plugin and run the integration tests. The problem is starting elasticsearch after installing the plugin. I get a few of these kind of exceptions:

Could not find a suitable constructor in Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.

The weird part is that I did not touch this class Caches. I read about making sure to use the right versions of elasticsearch and lucene. I am using 6.1.0 for elasticsearch and 7.1.0 for Lucene. Does anyone have suggestions how to progress?

If you want to try it out, my branch can be found here:


(Ryan Ernst) #2

That plugin is not maintained by Elastic. You should ask the plugin author.But in general, glancing at the code, it does not look like Caches it bound in guice, so you won't be able to get a reference to it via injection.

(Jettro Coenradie) #3

Thanks for looking, I understand it is not an elastic problem. But as I only have the problem when trying to upgrade to elastic 6 I was hoping someone would have had the same problem and could give me a pointer to a resolution.

(Jettro Coenradie) #4

One of the original authors of the plugin noticed I had removed the createComponents methods from the plugin. I commented it as the signature changed, I forgot to look if there is an alternative. I needed the components to be constructed with Guice interfering. Re-enabling the method fixes my problem.

(system) #5

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