-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoSuchMethodError in OcrFieldHighlighter with Solr 9.7 #457
Closed
Labels
bug
Something isn't working
Comments
Thanks for reporting, I'll start work on Solr 9.7 compatibility soon, likely not before October 1st though, I'm on vacation for the next two weeks. |
jbaiter
added a commit
that referenced
this issue
Sep 12, 2024
This one was fun. Lucene 9.11 changed the signature for the `FieldHighlighter` constructor to add an 8th parameter. This meant that we had to call different constructors for different Solr/Lucene versions. Unfortunately, Java requires that the superclass constructor invocation must be the first top-level statement in a subclass constructor, i.e. dynamic selection is not possible in Java. It is however no problem at the bytecode level, and so we supply a handcrafted (via `jasm`) `FieldHighlighterAdapter.class` that does the dynamic superclass constructor invocation. It's shipped as a precompiled .class (along with the commented .jasm source code and build instructions) since I could for the life of me figure out how to integrate jasm into the maven build. Maven woes also required removing the JavaDoc plugin, since that was unable to pick up the .class from the resources directory. Since the plugin is not really used as a library anyway, I think this is an acceptable tradeoff.
jbaiter
added a commit
that referenced
this issue
Sep 12, 2024
This one was fun. Lucene 9.11 changed the signature for the `FieldHighlighter` constructor to add an 8th parameter. This meant that we had to call different constructors for different Solr/Lucene versions. Unfortunately, Java requires that the superclass constructor invocation must be the first top-level statement in a subclass constructor, i.e. dynamic selection is not possible in Java. It is however no problem at the bytecode level, and so we supply a handcrafted (via `jasm`) `FieldHighlighterAdapter.class` that does the dynamic superclass constructor invocation. It's shipped as a precompiled .class (along with the commented .jasm source code and build instructions) since I could for the life of me figure out how to integrate jasm into the maven build. Maven woes also required removing the JavaDoc plugin, since that was unable to pick up the .class from the resources directory. Since the plugin is not really used as a library anyway, I think this is an acceptable tradeoff.
jbaiter
added a commit
that referenced
this issue
Sep 12, 2024
This one was fun. Lucene 9.11 changed the signature for the `FieldHighlighter` constructor to add an 8th parameter. This meant that we had to call different constructors for different Solr/Lucene versions. Unfortunately, Java requires that the superclass constructor invocation must be the first top-level statement in a subclass constructor, i.e. dynamic selection is not possible in Java. It is however no problem at the bytecode level, and so we supply a handcrafted (via `jasm`) `FieldHighlighterAdapter.class` that does the dynamic superclass constructor invocation. It's shipped as a precompiled .class (along with the commented .jasm source code and build instructions) since I could not for the life of me figure out how to integrate jasm into the maven build. Maven woes also required removing the JavaDoc plugin, since that was unable to pick up the .class from the resources directory. Since the plugin is not really used as a library anyway, I think this is an acceptable tradeoff.
jbaiter
added a commit
that referenced
this issue
Sep 12, 2024
This one was fun. Lucene 9.11 changed the signature for the `FieldHighlighter` constructor to add an 8th parameter. This meant that we had to call different constructors for different Solr/Lucene versions. Unfortunately, Java requires that the superclass constructor invocation must be the first top-level statement in a subclass constructor, i.e. dynamic selection is not possible in Java. It is however no problem at the bytecode level, and so we supply a handcrafted (via `jasm`) `FieldHighlighterAdapter.class` that does the dynamic superclass constructor invocation. It's shipped as a precompiled .class (along with the commented .jasm source code and build instructions) since I could not for the life of me figure out how to integrate jasm into the maven build. Maven woes also required removing the JavaDoc plugin, since that was unable to pick up the .class from the resources directory. Since the plugin is not really used as a library anyway, I think this is an acceptable tradeoff.
Latest release 0.9.1 with support for Solr 9.7 was just released, please give it a try! |
Thank you for your quick response and the update release. Your changes seem to work, see kitodo/kitodo-presentation#1335. Have a nice vacation! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello DBMDZ-Team,
there is an incompatibility with the recently released Solr 9.7. Version 9.7 depends on Lucene 9.11.1, which changed the constructor of FieldHighlighter , which doesn't match OcrFieldHighlighter any more.
Steps to reproduce the behavior
Run kitodo/kitodo-presentation functional tests with Solr 9.7 and
solr-ocrhighlighting-0.9.0.jar
.The issue does not occur with Solr 9.6.
Cheers,
Thomas
The text was updated successfully, but these errors were encountered: