[
https://issues.redhat.com/browse/WFLY-12668?page=com.atlassian.jira.plugi...
]
Bartosz Baranowski resolved WFLY-12668.
---------------------------------------
Resolution: Out of Date
10:40 $ curl -X POST -H "Content-Type: application/json" -d '{
"value": "123" }'
http://localhost:8080/wildfly-validation-bug/rest/test
success✔ ~/redhat/tmp/wildfly-validation-bug [master|✔]
10:40 $ curl -X POST -H "Content-Type: application/json" -d '1234'
http://localhost:8080/wildfly-validation-bug/rest/test
javax.ws.rs.ProcessingException: RESTEASY008200: JSON Binding deserialization error:
javax.json.bind.JsonbException: Error deserialize JSON value into type: class
boundary.model.MyModel.✔ ~/redhat/tmp/wildfly-validation-bug [master|✔]
10:41 $ curl -X POST -H "Content-Type: application/json" -d '1234'
http://localhost:8080/wildfly-validation-bug/rest/test
javax.ws.rs.ProcessingException: RESTEASY008200: JSON Binding deserialization error:
javax.json.bind.JsonbException: Error deserialize JSON value into type: class
boundary.model.MyModel.✔ ~/redhat/tmp/wildfly-validation-bug [master|✔]
Bean validation is done twice in JAX-RS application
---------------------------------------------------
Key: WFLY-12668
URL:
https://issues.redhat.com/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: Bartosz Baranowski
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
(v8.13.1#813001)