2 Replies Latest reply on Jul 29, 2010 3:01 PM by Wang Liyu

    Weld bug? @Produces method with Normal scope cause exception

    Wang Liyu Apprentice

      I have Bean that has produces method:

      public class LoginSession {
         private User user;

         @Produces @Named @RequestScoped
         public User getUser() { return user;}

      when deploying this, server report excecption:

      SEVERE: Exception sending context initialized event to listener instance of class org.jboss.weld.environment.servlet.Listener
      javax.enterprise.inject.UnproxyableResolutionException: Normal scoped bean org.jboss.weld.bean-flat-ProducerMethod-LoginSession.getUser() is not proxyable

      I'm using Weld1.0.1Final, and according to the weld-references(8.1. Scope of a producer method):

      @Produces @Preferred @SessionScoped
      public PaymentStrategy getPaymentStrategy() {

      Can anyone clarify this?