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

Semantics of injection for bean produced by method has changed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 10.0.0.CR4
    • CDI / Weld, EJB, REST
    • None
    • Hide

      $ git clone https://github.com/jpkrohling/stateless-with-random
      $ mvn clean install
      Deploy the generated WAR file into WF8/WF9
      $ curl localhost:8080/stateless-with-random
      $ curl localhost:8080/stateless-with-random
      Deploy the generated WAR file into WF10
      $ curl localhost:8080/stateless-with-random
      $ curl localhost:8080/stateless-with-random

      The results for WF8/WF9 should generate new UUIDs for each request.
      The results for WF10 shows the same UUID for all requests.

      Show
      $ git clone https://github.com/jpkrohling/stateless-with-random $ mvn clean install Deploy the generated WAR file into WF8/WF9 $ curl localhost:8080/stateless-with-random $ curl localhost:8080/stateless-with-random Deploy the generated WAR file into WF10 $ curl localhost:8080/stateless-with-random $ curl localhost:8080/stateless-with-random The results for WF8/WF9 should generate new UUIDs for each request. The results for WF10 shows the same UUID for all requests.
    • Hide

      https://github.com/jpkrohling/stateless-with-random

      Add a @Vetoed into the User class
      Add a @RequestScoped into the producer method

      Side effects:

      • as the User is now proxied by CDI, the proxy properties are also serialized.
      • an exception is thrown:
        No serializer found for class org.jboss.weld.bean.StringBeanIdentifier and no properties discovered to create BeanSerializer
      Show
      https://github.com/jpkrohling/stateless-with-random Add a @Vetoed into the User class Add a @RequestScoped into the producer method Side effects: as the User is now proxied by CDI, the proxy properties are also serialized. an exception is thrown: No serializer found for class org.jboss.weld.bean.StringBeanIdentifier and no properties discovered to create BeanSerializer

    Description

      On Wildfly 8 and Wildfly 9 (and JBoss AS versions before that), injecting a bean that is produced by a method into an Stateless bean would inject a new instance every time the stateless bean is used.

      On Wildfly 10, it seems that the first produced bean is used in all subsequent requests.

      Unfortunately, I could not find on any spec an authoritative answer for which behavior is the right one, so, I'm assuming that this is a regression.

      Attachments

        Issue Links

          Activity

            People

              sdouglas1@redhat.com Stuart Douglas
              jpkroehling@redhat.com Juraci Paixão Kröhling (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: