private String getDescription(BeanNotOfRequiredTypeException ex) {
   StringWriter description = new StringWriter();
   PrintWriter printer = new PrintWriter(description);
   printer.printf(
       "The bean '%s' could not be injected as a '%s' because it is a "
           + "JDK dynamic proxy that implements:%n",
       ex.getBeanName(), ex.getRequiredType().getName());
   for (Class<?> iface : ex.getRequiredType().getInterfaces()) {
     printer.println("\t" + iface.getName());
   }
   return description.toString();
 }
 @Override
 protected FailureAnalysis analyze(Throwable rootFailure, BeanNotOfRequiredTypeException cause) {
   if (!Proxy.isProxyClass(cause.getActualType())) {
     return null;
   }
   return new FailureAnalysis(getDescription(cause), ACTION, cause);
 }