-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
ClassNotFoundException with quarkus.hibernate-search.elasticsearch.analysis.configurer #5305
Comments
@yrodiere you think you could have a look? |
This looks a lot like I tried to create a reproducer, and it works as expected: https://github.com/yrodiere/quarkus-i5305 Tested on Fedora and Windows. Please check your setup or provide a reproducer. |
Notice that the Perhaps this is relevant to the recent change done in trimming property values #5050? |
@jaikiran Spot on, thanks for the heads up. Adding a trailing space does reproduce the issue. So this is a problem with the configuration extension rather than Hibernate Search: class names are not trimmed properly before Quarkus attempts to convert them to a @kenfinnigan, @dmlloyd, I'm not familiar with anything else than the Hibernate Search extension. Should we fix this by adding some trimming specifically for the Class converter, or is there a more global fix we should apply? As @gsmet said in your original pull request, I expect this will affect many property types. |
MP Config spec dictates that config values are not trimmed. So either we break the spec, or find a way to warn users about extraneous spaces |
@kenfinnigan Fair enough, but we are not talking about extraction of string values here, we are talking about extraction of The problem is that I have a Surely the spec doesn't mandate that we keep the trailing spaces and fail miserably when interpreting a property value as a I believe this has something to do with the built-in |
@kenfinnigan I don't think that's reasonable for classnames : the spec doesn't have our converters. Let's agree that the spec should be applied on String types - for other things we should be more pragmatic. |
But everything is a string type to start with |
sure, everything is a string to begin with. But the spec shouldn't say what we do within the implementation with those strings: it's not reasonable to not trim classnames. So I'd say this has nothing to do with spec compliance. |
I found this in
What if we added a |
@yrodiere +1 to patch there. |
Whatever is taking the String and converting it to a class should do the trimming. That does seem like clean DevX improvement and I can’t see any drawback. I can’t imagine the TCK testing that a trailing space should fail a class load. |
Meaning even if we only do it on known converters like integers and classes etc. That’s already progress. |
I believe that That said - for specific converters, I think we're nearly always "TCK-safe" if we accept values that are rejected by specification. The risk is that the spec is improved in such a way that it begins to accept values which were previously rejected and the result of conversion of such values differs from what our improvements resulted in. This is always something to keep in mind as we're always trying to improve the specification but don't always exactly get our way! That said - for class names and numerical values, it seems like an easy improvement to trim leading and trailing spaces... though at a very slight risk for classes (did you know that class names can contain spaces?). I don't know what kind of psychopath would generate a class with a space at the beginning or end of its name, but it's not disallowed! I think that trimming whitespace for enumerated values is reasonable as well. A question though: should we post a warning in cases like this, when we disregard trimmed whitespace? |
I'm working on a pull request. Let me know if I have to add a warning. |
Please hold off on any config-related changes for the next couple of days. I'm rebasing a way-too-large config fix branch and it's already very painful... |
@dmlloyd Sorry I saw your message too late, I was already almost done. Feel free to ignore my PR until you are done: I will rebase mine when yours is merged. |
The problem is solved in smallrye-config 1.4.0, but Quarkus is still using smallrye-config 1.3.9 at the moment. Upgrade PR: #5387 |
smallrye-config 1.5.1 is used now, can be this issue closed ? |
@rsvoboda good catch |
Describe the bug
Starting with Quarkus 0.28, the Quarkus augmentation phase fails with a
ClassNotFoundException
as soon as a value is configured using the propertyquarkus.hibernate-search.elasticsearch.analysis.configurer
.Expected behavior
With Quarkus version 0.27, the same class can be loaded without issue.
Actual behavior
Quarkus statup fails with the following stack trace:
To Reproduce
Steps to reproduce the behavior:
Hibernate Search + Elasticsearch
extension.org.acme.AnalysisConfigurer
) which implementsElasticsearchAnalysisConfigurer
.Configuration
Environment (please complete the following information):
uname -a
orver
:Microsoft Windows [Version 10.0.18362.418]
java -version
:Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
1.0.0.CR1
The text was updated successfully, but these errors were encountered: