Unable to locate MessageSource
I've been getting this message time and time again while defining it inside the applicationContext.xml
Following the countries example, i had only that bean defined inside the context, and the servlet beans in servletName-servlet.xml
after two hours of frustration i copied exactly the same bean into the servlet config, commenting out the one in the "context" and it worked!
applicationContext.xml
Code:
<beans>
<!--
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename"><value>messages</value></property>
</bean>
-->
</beans>
servletName-servlet.xml
Code:
<beans>
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename"><value>messages</value></property>
</bean>
No reference to the contextConfigLocation in web.xml just like countries.
I can't understand why countries load the messageSource inside the applicationContext.xml and not in servletName-servlet.xml like i did.
thanks
Fernando Racca
Do the simplest thing that could possibly work. - Kent Beck
Everything should be made as simple as possible, but not simpler. - Albert Einstein