[jboss-jira] [JBoss JIRA] (WFLY-11956) @PostConstruct on @ApplicationScoped bean called too late in case @Valid is annotated on a business method

Gunnar Morling (Jira) issues at jboss.org
Fri Apr 26 15:49:01 EDT 2019


    [ https://issues.jboss.org/browse/WFLY-11956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13727260#comment-13727260 ] 

Gunnar Morling commented on WFLY-11956:
---------------------------------------

{quote}
What does "if enabled" mean in this case? I did read that and assumed that there was a part of the spec I didn't understand.
{quote}

I was stumbling upon this one, too. IMO it doesn't make sense that it refers to the executable validation options, as this step is about validating properties (fields and getters). I have no good idea what else it could mean, would be nice to hear back from Santiago about this, too, in case he remembers.

> @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)


More information about the jboss-jira mailing list