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

Details

    • Hide

      See the attached playground.zip reproducer project...

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

    Description

      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...

      Attachments

        1. playground.zip
          17 kB
        2. logging.txt
          36 kB

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: