[
https://issues.jboss.org/browse/WFLY-11956?page=com.atlassian.jira.plugin...
]
Matěj Novotný commented on WFLY-11956:
--------------------------------------
bq. 2. The other issue is the fact that validation is instigated by
JaxrsInjectionTarget.inject(). Probably I should check for the presence of a
@PostConstruct annotated method, and, in its presence, start validation from
JaxrsInjectionTarget.postConstruct(). So that's a fixable bug.
[~ron_sigal] Like I said earlier, you can move the validation to the {{postConstruct()}}
instead of {{inject()}} method in all cases as that method did get invoked even if I
commented out the {{@PostConstruct}} method on the bean itself.
@PostConstruct on @ApplicationScoped bean called too late in case
@Valid is annotated on a business method
----------------------------------------------------------------------------------------------------------
Key: WFLY-11956
URL:
https://issues.jboss.org/browse/WFLY-11956
Project: WildFly
Issue Type: Bug
Components: Bean Validation, REST
Affects Versions: 16.0.0.Final
Reporter: Joerg Baesner
Assignee: Ronald Sigal
Priority: Major
Attachments: logging.txt, playground.zip
Having a bean class with {{@ApplicationScoped}}, which has a {{@PostConstruct}} and is
implementing the following _Interface_:
{code}
@Path("/validated")
public interface ValidatedJaxRsInterface {
@GET
@Valid
@Produces(MediaType.APPLICATION_JSON)
GreetingModel getHelloGreeting();
}
{code}
will result in calling the {{getHelloGreeting}} method of the implementation class twice
*_before_* the {{@PostConstruct}} is getting executed.
This can be reproduced with the attached reproducer application...
--
This message was sent by Atlassian Jira
(v7.12.1#712002)