Fix bean definition error on class attribute cannot use values from properties, use factory bean instead