• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

ResourceBundle [/WEB-INF/messageresource/welcome] not found for MessageSource

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to all,


I am getting error
ResourceBundle [/WEB-INF/messageresource/welcome] not found for MessageSource: Can't find bundle for base name /WEB-INF/messageresource/welcome, locale en. Even though i put in source path, it is not recognizing the messageresource in spring.

if any one knows, help me to fix this error.


Thanks inadvance,

With Regards,
srini


 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

srinivas Doni wrote:
ResourceBundle [/WEB-INF/messageresource/welcome] not found for MessageSource: Can't find bundle for base name /WEB-INF/messageresource/welcome, locale en.


The error message is self explanatory, you've to keep the welcome.properties file in "WEB-INF/messageresource/" dir.
Try this.
 
srinivas Doni
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sagar Rohankar,

even i put in src folder, it raises same error.


can you help me step by step process for to find message properties file



Thanks in advance

With Regards,
srini
 
Greenhorn
Posts: 7
Eclipse IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

You need to configure message resouce bundle like below in xml file.

<bean id="resource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
<value>filename without extension</value>
</list>
</property>
</bean>

<bean id="example" class="com.temp.Example">
<property name="messages" ref="messageSource"/>
</bean>

The File name which you provided that must be available in classpath. And because of that only you are getting this error "Can't find bundle for base name".

The Example class has below code

private MessageSource messages;

public void setMessages(MessageSource messages) {
this.messages = messages;
}

 
srinivas Doni
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
kunalkumar somani,

i put in message properties files in src folder and i copied these files in /web-inf/build/classes folder.

when i deploy project in tomcat server, again i am getting same error messge not found .
Actually problem is the request url
http://localhost:8080/SpringMVC/userForm.htm

when i append query string ?language=en_US to above url , then only it is working.
// userForm.jsp



//web.xml


// dispatch servlet.xml


Even i am sending form with method=get,
it does not append query string automatically, help me to resolve this error.

Thanks in advance
With Regards,
srini



 
kunalkumar somani
Greenhorn
Posts: 7
Eclipse IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Srinivas,

You can use org.springframework.context.support.ReloadableResourceBundleMessageSource instead of org.springframework.context.support.ResourceBundleMessageSource.




hope works well....
 
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

srinivas Doni wrote:Hi to all,


I am getting error
ResourceBundle [/WEB-INF/messageresource/welcome] not found for MessageSource: Can't find bundle for base name /WEB-INF/messageresource/welcome, locale en. Even though i put in source path, it is not recognizing the messageresource in spring.

if any one knows, help me to fix this error.


Thanks inadvance,

With Regards,
srini






After reviewing the error message I can tell that your bean "messageSource" is not probably configured.

Here a solution based on your configuration.

What you have: <property name="basename" value="/messageresource/welcome"/>

Problem: The problem is where you specified the value contents ""/messageresource/welcome" incorrectly, therefore, it can't find your property file.

Solution: Change to "<property name="basename" value="/WEB-INF/messages/messages" />" based on your configuration.

Your welcome.properties file must place in "/WEB-INF/messageresource/" directory in your webapp. The "welcome" is just a properties name or whatever you called follow after the directory.



Example,



Refer to Spring reference document if you need for info...hope it help.




 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kudos it helped to resolve the issue of loading property file
thanks a ton

Tommy Delson wrote:

srinivas Doni wrote:Hi to all,


I am getting error
ResourceBundle [/WEB-INF/messageresource/welcome] not found for MessageSource: Can't find bundle for base name /WEB-INF/messageresource/welcome, locale en. Even though i put in source path, it is not recognizing the messageresource in spring.

if any one knows, help me to fix this error.


Thanks inadvance,

With Regards,
srini






After reviewing the error message I can tell that your bean "messageSource" is not probably configured.

Here a solution based on your configuration.

What you have: <property name="basename" value="/messageresource/welcome"/>

Problem: The problem is where you specified the value contents ""/messageresource/welcome" incorrectly, therefore, it can't find your property file.

Solution: Change to "<property name="basename" value="/WEB-INF/messages/messages" />" based on your configuration.

Your welcome.properties file must place in "/WEB-INF/messageresource/" directory in your webapp. The "welcome" is just a properties name or whatever you called follow after the directory.



Example,



Refer to Spring reference document if you need for info...hope it help.




 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic