title: Java - NoSuchMethodException with reflection
body: <p>I get a <code>NoSuchMethodException</code> when executing:</p>
  
  <pre><code>operacionDTO.getClass().getMethod("setPrioridad").invoke(operacionDTO, 0);
  
  java.lang.NoSuchMethodException: xxxx.api.service.dto.RegasificacionDTO.setPrioridad()
  </code></pre>
  
  <p>But class <code>RegasificacionDTO</code> does have a public method called <code>setPrioridad(int i)</code>, and if when debugging I call:</p>
  
  <pre><code>operacionDTO.getClass().getMethods()
  </code></pre>
  
  <p>Then I get an array of Method in which there is a <code>setPrioridad</code>. I've tried with some other similar methods and I get the same error.</p>