Description
I am trying to upgrade spring from 3.2.1 to 4.0.2 which requires us to use <el-resolver> instead of <variable-resolver> (it was deprecated from quite sometime). The upgrade throws an PropertyNotWritableException after using SpringBeanFacesELResolver. The exception is thrown by the setValue() method which checks if the requested bean is present in the BeanFactory. If found, a PropertyNotWritableException is thrown. I would like to understand the root cause of the exception which is not clear from its implementation.
public void setValue(ELContext elContext, Object base, Object property, Object value) throws ELException { if (base == null) { String beanName = property.toString(); BeanFactory bf = getBeanFactory(elContext); if (bf.containsBean(beanName)) { throw new PropertyNotWritableException( "Variable '" + beanName + "' refers to a Spring bean which by definition is not writable"); } } }
The setValue() implementation doesn't set the value but just do a check. On debugging I found the value of beanName, value and property refer to the same backing bean. Does that cause the issue? If so why?