Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-11956

@PostConstruct on @ApplicationScoped bean called too late in case @Valid is annotated on a business method

XMLWordPrintable

    • Hide

      See the attached playground.zip reproducer project...

      Show
      See the attached playground.zip reproducer project...

      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 twice before the @PostConstruct is getting executed.

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

        1. logging.txt
          36 kB
          Brian Stansberry

              rsigal@redhat.com Ronald Sigal
              rhn-support-jbaesner Joerg Baesner
              Votes:
              0 Vote for this issue
              Watchers:
              13 Start watching this issue

                Created:
                Updated:
                Resolved: