You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using camel bean-validator throws ContextNotActiveException when quarkus-resteasy-reactive-jackson dependency is also present and the provided bean is invalid based on the validation annotations.
Also with quarkus-resteasy-reactive-jackson the bean validator exception is of type javax.validation.ValidationException
while without this dependency the associated exception is of type org.apache.camel.ValidationException.
The issue is that in the first case and due to then ContextNotActiveException we cannot have a clue regarding the invalid fields.
Expected behavior
Bean validator should work without throwing ContextNotActiveException
Actual behavior
Bean validator throws ContextNotActiveException in case of an invalid bean.
The exact problem resides in then ResteasyReactiveContextLocaleResolver class and specifically in the following call: headers.getLength();
running the test in the main branch where quarkus-resteasy-reactive-jackson is not present you can see that everything is working fine.
An org.apache.camel.ValidationException is being thrown as you can see in the console logs with the following message:
class org.apache.camel.component.bean.validator.BeanValidationException : Validation failed for: {"field":""} errors: [property: field; value: ; constraint: must not be blank; ]
But running the same test in the problem branch, you'll find out that a javax.validation.ValidationException is being thrown and the message is
class javax.validation.ValidationException : HV000149: An exception occurred during message interpolation : javax.enterprise.context.ContextNotActiveException
Output of uname -a or ver
Linux dell-desktop 5.10.0-1057-oem #61-Ubuntu SMP Thu Jan 13 15:06:11 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version
corretto-11
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.6.3.Final
Build tool (ie. output of mvnw --version or gradlew --version)
Gradle 7.3.3
Additional information
No response
The text was updated successfully, but these errors were encountered:
Hello @geoand
the test is passing in both branches as the assertion is trivial.
You can identfy the issue by examining the produced logs after each execution though, as I explained above.
thnx
geoand
added a commit
to geoand/quarkus
that referenced
this issue
Jan 26, 2022
Describe the bug
Using camel bean-validator throws
ContextNotActiveException
whenquarkus-resteasy-reactive-jackson
dependency is also present and the provided bean is invalid based on the validation annotations.Also with
quarkus-resteasy-reactive-jackson
the bean validator exception is of typejavax.validation.ValidationException
while without this dependency the associated exception is of type
org.apache.camel.ValidationException
.The issue is that in the first case and due to then
ContextNotActiveException
we cannot have a clue regarding the invalid fields.Expected behavior
Bean validator should work without throwing
ContextNotActiveException
Actual behavior
Bean validator throws
ContextNotActiveException
in case of an invalid bean.The exact problem resides in then
ResteasyReactiveContextLocaleResolver
class and specifically in the following call:headers.getLength();
How to Reproduce?
Reporducer: https://github.com/nikosk686/quarkus-camel-bean-validation-poc
running the test in the
main
branch wherequarkus-resteasy-reactive-jackson
is not present you can see that everything is working fine.An
org.apache.camel.ValidationException
is being thrown as you can see in the console logs with the following message:But running the same test in the
problem
branch, you'll find out that ajavax.validation.ValidationException
is being thrown and the message isOutput of
uname -a
orver
Linux dell-desktop 5.10.0-1057-oem #61-Ubuntu SMP Thu Jan 13 15:06:11 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
corretto-11
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.6.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.3.3
Additional information
No response
The text was updated successfully, but these errors were encountered: