Error creating bean with name messageSource




Asked on August 15, 2013
        Error creating bean with name messageSource defined in class path resource spring.xml: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property prop of bean class org.springframework.context.support.ResourceBundleMessageSource: Bean property prop is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)




Replied on August 15, 2013
I am not sure what I changed and my app is not working


Replied on August 15, 2013
Error says that Spring is unable to find the bean property as prop , post your the code of XML




Replied on August 15, 2013
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
 <property name="prop">
   <list>
     <value>dbprop</value>
   </list>
 </property>



Replied on August 15, 2013
prop should be basenames, run and check


Write Answer










©2024 concretepage.com | Privacy Policy | Contact Us