[
https://issues.jboss.org/browse/WFLY-12668?page=com.atlassian.jira.plugin...
]
Daniel Munzinger updated WFLY-12668:
------------------------------------
Steps to Reproduce:
I created a basic examle at
https://github.com/bender316/wildfly-validation-bug
You can either download the wildfly-validation-bug.war or clone the repository and do
"gradle war" and deploy the war in build/libs to the WildFly.
Steps:
1. Deploy war
2. Do a valid POST request against
http://localhost:9080/wildfly-validation-bug/rest/test
with the body:
{{
\{
"value": "123"
\}
}}
3. Do an invalid POST request with four characters (e.g. "1234" in the value
field.
4. Check result. There should be two error messages with the same content.
5. Do 3. and 4. again. There should now be only 1 error message.
6. Repeat 2. to 5.
was:
I created a basic examle at
https://github.com/bender316/wildfly-validation-bug
You can either download the wildfly-validation-bug.war or clone the repository and do
"gradle war" and deploy the war in build/libs to the WildFly.
Steps:
1. Deploy war
2. Do a valid POST request against
http://localhost:9080/wildfly-validation-bug/rest/test
with the body:
{{\{
"value": "123"
\}}}
3. Do an invalid POST request with four characters (e.g. "1234" in the value
field.
4. Check result. There should be two error messages with the same content.
5. Do 3. and 4. again. There should now be only 1 error message.
6. Repeat 2. to 5.
Bean validation is done twice in JAX-RS application
---------------------------------------------------
Key: WFLY-12668
URL:
https://issues.jboss.org/browse/WFLY-12668
Project: WildFly
Issue Type: Bug
Components: Bean Validation, EJB, REST
Affects Versions: 17.0.1.Final, 18.0.0.Final
Environment: OpenJDK 11, reproduced on Win10 and Ubuntu 18.x
Reporter: Daniel Munzinger
Assignee: Cheng Fang
Priority: Major
If a JAX-RS resource is implemented as a stateless session bean then the validation is
done twice: first on the EJB proxy and on the real implementation. This results in two
constraint errors although there is basically just one error.
The interesting part: If you resend the request. Then you get a proper result with just
one violation. If you do a valid request and then an invalid you get the two violations
again (see also the reproduce section).
I created the issue here because I think it is an integration issue with JAX-RS, bean
validation and EJBs.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)