2 Replies Latest reply on Jan 26, 2010 3:24 PM by Pete Muir

    Reflection not possible on Field

    alberto Gori Novice

      If CDI is proxying a bean, I can't set a field value using reflection:




      Field f = HelloBean.class.getDeclaredField("user");
      f.setAccessible(true);
      f.set(myHelloBean, new User());
      



      This code does nothing. User field is still null.
      How are we supposed to use reflection on CDI managed beans?