Announcement Announcement Module
No announcement yet.
Message Bundle - No Message Found exception Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Message Bundle - No Message Found exception

    Hi friends,
    I m getting following exception when trying to use message bundle. I dont know if spring is able to find my message, which is in class folder of app.

    org.springframework.context.NoSuchMessageException : No message found under code '' for locale 'en_US'. ageSource.getMessage( 77) ationContext.getMessage(AbstractApplicationContext .java:630) text.getMessage( .getErrorMessages( .<init>(
    org.springframework.web.servlet.tags.BindTag.doSta rtTagInternal(
    org.springframework.web.servlet.tags.RequestContex tAwareTag.doStartTag( 8)
    org.apache.jsp.WEB_002dINF.jsp.main.setupperiod_js p._jspService(org.apache.jsp.WEB_002dINF.jsp.main. setupperiod_jsp:146)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
    org.apache.jasper.servlet.JspServletWrapper.servic e(
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
    org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel

    Above exception occurs when I try to display errors through
    <c:forEach items="${status.errorMessages}" var ="errorMessage">
    <font color=red><c:out value="${errorMessage}" /><br></font>

    My Message bundle
    ----------------------------- = Date cannot be greater than 28 for normal year = Date cannot be greater than 29 for leap year

    Please kindly help to resolve the issue.
    Thanks !!!

    Aru K

  • #2
    Is your resource bundle defined as message source in your servlet definition?



    • #3
      Yes friend.

      It is:

      <!-- Message resource declaration -->
      <bean id="messageResource" class=" eBundleMessageSource">
      <property name="basename">

      Please help to solve this issue.

      Aru K


      • #4
        Isn't it supposed to be <bean id="messageSource"


        • #5
          I had a similar issue. I used classpath:. I believe that resolved it. And I do believe the id needs to be "messageSource" as already stated.

          	<bean id="messageSource"
          		<property name="basename" value="classpath:tscart-messages" />
          		<property name="fallbackToSystemLocale" value="false" />


          • #6
            bean &quot;messageSource&quot; loaded in wrong context

            Hi, for me the problem was solved when I moved the "messageSource" definition from the servlet context, e.g. "shippingrate-servlet.xml" to my root context "applicationContext.xml" The reason was that the code was trying to reach the message source in the root context.



            • #7
              Perhaps a rather late reaction, but it could be useful to others:
              I had the same problem, and it was due to a classpath problem. There was another file on my classpath, which was found before the one in my WEB-INF folder.
              So, cleaning your project, or renaming the file to could do the trick.


              • #8

                I had the same problem too. In my case the problem was the use of ReloadableResourceBundleMessageSource in the *-servlet.xml. The problem disappeared when I replace it for ResourceBundleMessageSource.


                • #9
                  Hi, I have a similiar problem, I'd appreciate some help with this...
                  I have a configured in my applicationContext.xml and it was working fine. Now I get a "No message found under code myCode for locale es_ES" but just with ONE of the messages. All other error message is displayed with no problem.
                  I'm using SpringMVC.


                  • #10
                    &lt;spring:message&gt; tag not finding properties file code

                    Yes, for me it was what Peter Odéus did to solve the problem. I had a login.jsp file that was just outside the WEB-INF directory, so the <spring:message> codes were not being found. I switched the bean call as Junior Member Peter Odéus did to the applicatonContext.xml root spring configuration file and viola, the <spring:message> tag found the code and now I can complete internationalization (i18n) for my project by localizing the login.jsp page.
                    Thanks Peter.........


                    • #11
                      I also had the same issue. early i used ResourceBundleMessageResource. I replaced it in this way.
                      Note : i m using following resouce bundles

                      <bean id="messageSource" class=" bleResourceBundleMessageSource">
                      <property name="basenames">


                      • #12
                        I am facing issue while loading locale specific file.
                        Log message that I would see is

                        - Loading properties []
                        - No properties file found for [classpath:resource/messagebundle/Messages_en_us] - neither plain properties nor XML

                        Here is the configuration file.

                        <bean id="messageSource" class=" bleResourceBundleMessageSource">
                        <property name="basenames" value="classpath:resource/messagebundle/Messages" />
                        <property name="fallbackToSystemLocale" value="false" />

                        Am I missing some configuration?
                        Any help would be greate.



                        • #13
                          I got it.
                          There is was an issue of "_US" and "_us".
                          If I remove <property name="fallbackToSystemLocale" value="false" /> from configuration it will check for all combinations like "_en", "_en_us", "_en_US" etc.
                          But if I keep that configuration it will looks for specific "_en_us" and will fail if not found.



                          • #14
                            Place the .properties file

                            Hi Friends

                            place your .properties (ex.. in you src directory

                            Last edited by deepaksurthi; Aug 12th, 2010, 06:34 AM.


                            • #15
                              I finally got it , adding

                              "<property name="fallbackToSystemLocale" value="false" />"

                              but now , the labels don't change . Here is my conf :

                              <!-- Configuracion de mensajes - internacionalizacion -->
                              <bean id="messageSource"
                              class=" bleResourceBundleMessageSource">
                              <property name="basename" value="classpath:message" />
                              <property name="fallbackToSystemLocale" value="false" />

                              <bean id="localeResolver"
                              class="org.springframework.web.servlet.i18n.Sessio nLocaleResolver">
                              <property name="defaultLocale" value="es" />

                              <bean id="localeChangeInterceptor"
                              class="org.springframework.web.servlet.i18n.Locale ChangeInterceptor">
                              <property name="paramName" value="lang" />

                              <bean id="handlerMapping"
                              class="org.springframework.web.servlet.mvc.annotat ion.DefaultAnnotationHandlerMapping">
                              <property name="interceptors">
                              <ref bean="localeChangeInterceptor" />

                              No exception (this problem it's solved), so I guess it finds the files, but I have no change in the labels. My files are in


                              any clue (thanks in advance) ??