helidon
helidon copied to clipboard
Fix Micronaut integration
Environment Details
- Helidon Version: 4.x
- Helidon SE or Helidon MP
- JDK version:
- OS:
- Docker version (if applicable):
Problem Description
Micronaut has just released 4.0 (11 July 2023) which, among other things, has breaking changes regarding javax
vs. jakarta
in some areas including validation, as described in this excerpt from Slack:
I'm having issue of imcompatibilty of the jakarta.validation and javax.validation. The
jakarta.validation
(I'm refering to the constraintsimport jakarta.validation.constraints.*
in to the model) doesn't work with micronaut@Validated
inCrudRepository
as it does not trigger the validation due thehelidon.integrations.micronaut
it only supportjavax.validation
instead (tested it work).version.lib.micronaut>3.4.3</version.lib.micronaut>, version.lib.micronaut.data>3.3.0</version.lib.micronaut.data>
However with the use of
javax.validation.*
it create issue for manual validation, theValidation.buildDefaultValidatorFactory()
doest work withjavax
, which trigger the error.[helidon-server-1] ERROR xxx.GlobalExceptionHandler - Unable to create a Configuration, because no Jakarta Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath. javax.validation.NoProviderFoundException: Unable to create a Configuration, because no Jakarta Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
As Micronaut 4.0 contains breaking changes from Micronaut 3.x, we probably would not want to change the Micronaut dependency to 4.0 in a Helidon 3.x dot release (as the original poster in Slack inquired about).
But do we want to consider updating the Micronaut dependency to 4.0 in Helidon 4.x?
I am verifying this with Micronaut 4.1.0 in Helidon 4.x
It still depends on javax
, for example io.micronaut.annotation.processing.TypeElementVisitorProcessor
contains the next imports:
import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedOptions;
But in Helidon we have jakarta.annotation:jakarta.annotation-api:jar:2.1.1
that uses the package names with jakarta
. I think we cannot integrate Micronaut 4x yet.
These are JAVA JDK java.compiler library, would this impact the integration ? I believe these namespace will not be change for the JAVA platform.
These are JAVA JDK java.compiler library, would this impact the integration ? I believe these namespace will not be change for the JAVA platform.
Correct, jakarta.annotation:jakarta.annotation-api:jar:2.1.1
is not the replacement of javax.annotation.processing
.
Hi All,
I would like to know when will this fix to be release, any expected date ?
Hi All,
Any expected date to be release the Micronut integration fix ?
Hi All,
Any expected date to be release the Micronut integration fix ?
There is a PR but it is pending to be reviewed. I think we will know the date once it is approved and merged.