PDA

View Full Version : Can't find bundle for base name classpath:message


tdhaayushverma
Jun 5th, 2008, 06:22 PM
Hi

I am having trouble in getting the resource bundle getting picked up by my app.

Here are the configs setting:
*-servlet.xml

<!-- Message Source -->
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundle MessageSource">
<property name="basename" value="classpath:message"></property>
</bean>


And I have the corresponding message.properties in my classpath and when i build , I can see the file under /classes/message.properties.

But when I run myapp ( tomcat 6 ) , I get the following error:

[org.springframework.context.support.ResourceBundle MessageSource] - <ResourceBundle [classpath:message] not found for MessageSource: Can't find bundle for base name classpath:message, locale en_US>

- I have tried different things ( after googling around )
like : changing the value specified in the basename to /WEB-INF/message and then keeping the massage.properties under the directory /WEB-INF/messsage.properties

Also i tried to change the name of the file to mymessage.properties and ofcourse change the basename to mymessage.properties. But no luck.
but I cant get this simple thing to work.
Any help is much appreciated.

tdhaayushverma
Jun 12th, 2008, 05:39 PM
Its been a while and i am still stuck on this. Any help plz.

smrutimo
Jun 12th, 2008, 06:10 PM
Did you try removing the "classpath:" and just try with "message" ? You dont need to prefix it with "classpath:" and you also dont need to suffix with ".properties"

tdhaayushverma
Jun 12th, 2008, 06:21 PM
removing the classpath did the trick.

I was trying this for a long time. tried so many things but didnt remove that stupid classpath.
This forum is great.

Thank you very much.

Although why would the classpath option not work. \I have a similar setting in my web.xml and that works fine.
Example:
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:pollcentral-servlet.xml</param-value>
</init-param>