Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-16939

[GSS](7.2.z) [EAP] Validation of @ApplicationScoped bean's business method performed before @PostConstruct callback

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.2.3.CR1, 7.2.3.GA
    • 7.2.0.GA
    • REST
    • None

      Having a bean class with @ApplicationScoped, which has a @PostConstruct and is implementing the following Interface:

      @Path("/validated")
      public interface ValidatedJaxRsInterface {
          
          @GET
          @Valid
          @Produces(MediaType.APPLICATION_JSON)
          GreetingModel getHelloGreeting();
      }
      

      will result in calling the getHelloGreeting method of the implementation class before the @PostConstruct is getting executed.

      This can be reproduced with the attached reproducer application...

      NOTE: There is a side-issue that the getHelloGreeting is called twice. As per discussion on WFLY-11987 this is not in scope of this fix.

              spyrkob Bartosz Spyrko-Smietanko
              spyrkob Bartosz Spyrko-Smietanko
              Daniel Cihak Daniel Cihak
              Daniel Cihak Daniel Cihak
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: