title: Exception trying to change a CGLib proxy field value
body: <p>I created a CGLib dynamic proxy of a class, but when I try to access any field declared in the original class, I obtain java.lang.NoSuchFieldException. I need to obtain the field in order to change its value.</p>
  
  <p>By the way, this is the class the proxy is based on:</p>
  
  <pre><code>public class Person {
  
      private String name;
      ....
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
      ...
  }
  </code></pre>
  
  <p>And this is the code snippet (inside the "intercept" method of the "MethodInterceptor") that is raising the mentioned exception (more specifically the first line):</p>
  
  <pre><code>public Object intercept(Object instance, Method jdkMethod, Object[] args, MethodProxy method) throws Throwable {
  ...
  Field field = instance.getClass().getField("name");
  field.setAccessible(true);
  field.set(instance, "foo");
  ....
  </code></pre>
  
  <p>Do you know any other way to access the needed field or change its value?</p>
  
  <p>Thanks.</p>