}
else {
Class beanClass = bean.getClass();
Method namedPCLRemover = getNamedPCLRemover(beanClass);
if (namedPCLRemover == null)
throw new FatalBeanException("Could not find the bean method"
+ "/npublic void removePropertyChangeListener(String, PropertyChangeListener);/nin bean '"
+ bean + "'");
try {
namedPCLRemover.invoke(bean, new Object[] {propertyName, listener});
}
catch (InvocationTargetException e) {
throw new FatalBeanException("Due to an InvocationTargetException we failed to remove "
+ "a named PropertyChangeListener from bean '" + bean + "'", e);
}
catch (IllegalAccessException e) {
throw new FatalBeanException("Due to an IllegalAccessException we failed to remove "
+ "a named PropertyChangeListener from bean '" + bean + "'", e);
}
}
}