Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7129449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:14:38+00:00 2026-05-28T11:14:38+00:00

org.springframework.context.NoSuchMessageException: No message found under code ‘user.username.empty’ for locale ‘en_GB’. Currently I have the

  • 0

org.springframework.context.NoSuchMessageException: No message found under code ‘user.username.empty’ for locale ‘en_GB’.

Currently I have the following code:

applicationContext.xml:

<bean id="messageSource"
      class="org.springframework.context.support.ResourceBundleMessageSource"
      p:basename="messages" />

What I’m trying to do is cause an error to appear for the user if when they try and register on my site with a blank username, it will give them the error defined as user.username.empty. My application is working as intended and it’s looking for the error user.username.empty, however it cannot find it no matter where I put the properties file.

What folder do I need to put the properties file and how do I need it named?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:14:38+00:00Added an answer on May 28, 2026 at 11:14 am

    It must be named messages.properties, and be in the classpath, in the default package. And it must of course contain such a line:

    user.username.empty=the message you want
    

    You may customize it for en_GB by using a file named messages_en_GB.properties, in the same location.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

error message: SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
Is it safe to assume that all implementations of org.springframework.context.MessageSource interface are thread-safe after
My spring-context file is shown below. <beans xmlns=http://www.springframework.org/schema/beans xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:aop=http://www.springframework.org/schema/aop xmlns:jee=http://www.springframework.org/schema/jee xmlns:jms=http://www.springframework.org/schema/jms xmlns:lang=http://www.springframework.org/schema/lang xmlns:tx=http://www.springframework.org/schema/tx
In my application I already use ResourceBundleMessageSource <bean id=messageSource class=org.springframework.context.support.ResourceBundleMessageSource p:basename=i18n/messages /> And all
applicationContext-Service.xml <bean id=messageSource class=org.springframework.context.support.ReloadableResourceBundleMessageSource> <property name=basenames> <list><value>messages</value></list> </property> </bean> I have messages_en_US.properties under /src/messages_en_US.properties
<bean id=messageSource class=org.springframework.context.support.ResourceBundleMessageSource p:basename=messages /> bean and obviously in my velocity files I can
Im trying to run my project, but this error hits me everytime: org.springframework.web.context.ContextLoaderListener java.lang.NoSuchMethodError:
I don't get this, I have a typical messageSource <bean id=resource class=org.springframework.context.support.ResourceBundleMessageSource> <property name=basenames>
I am getting an exception <code> Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name
I notice that there is getWebApplicationContext in org.springframework.web.servlet.mvc.AbstractController . This means that spring programmers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.