Can’t find bundle for base name xxx, locale en_US

Problem

In JSF web application , load a message bundle in application level like this :
faces-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<faces-config
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
    version="2.0">
     <application>
	<message-bundle>
		com.mkyong.payment_error
	</message-bundle>
     </application>
</faces-config>

When the page is rendered, it hits “Can’t find bundle for base name com.mkyong.payment_error, locale en_US“?

Solution

Obviously, the bundle or properties file (com.mkyong.payment_error.properties) is missing, make sure the name is match and placed in the resource folder properly.

For Eclipse User
This problem is usually happened in the Eclipse IDE environment, where it doesn’t copy the “.properties” file extension by default. So, just make sure the properties file is existed in the run time “classes” folder and can be located by your web application.
Tags :

About the Author

mkyong
Founder of Mkyong.com and HostingCompass.com, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.

Comments

  • Pingback: house blue()

  • Pingback: water ionizer pay plan loans()

  • Pingback: locksmith kit for cars()

  • Pingback: useful link()

  • Pingback: pay per day loans plan()

  • Pingback: stop parking()

  • Pingback: Instagram followers kopen()

  • Pingback: water ionizers()

  • Pingback: water ionizer()

  • Pingback: mp4 mobile porn()

  • Pingback: parking()

  • Pingback: lan nu()

  • Pingback: DIRECTV for your company()

  • Pingback: get satellite tv()

  • Pingback: Blue Coaster33()

  • demonz11b

    very useful. thanks. shame on eclipse.

  • jsmile

    I have encounted a similar error.

    “java.util.MissingResourceException: Can’t find bundle for base name javax.faces.Messages, locale en_US
    ….”

    ( environment )
    jdk1.6.0_29
    Apache Tomcat/7.0.22
    eclipse-jee-indigo-SR1-win32

    ( WEB-INF\lib\faces-config.xml )

    &lt;faces-config xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;
        xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
        xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd&quot;
        version=&quot;1.2&quot;&gt;
     
    &lt;application&gt;
    	&lt;resource-bundle&gt;
    		&lt;base-name&gt;guessNumber.ApplicationMessages&lt;/base-name&gt;
    		&lt;var&gt;ErrMsg&lt;/var&gt;
    	&lt;/resource-bundle&gt;
    	&lt;locale-config&gt;
          &lt;default-locale&gt;en_US&lt;/default-locale&gt;
        &lt;/locale-config&gt;	
    &lt;/application&gt;

    ( src\guessNumber\ApplicationMessages.properties )

    What’s my problem ?

  • dimmid

    I get a java.util.MissingResourceException: Can’t find bundle for base name i18n.messages, locale sv … (that’s swedish)

    I’m using Eclipse 3.6
    The property file exists under the run time “classes” (as you mentioned)

    When language is set to English in my browser the problem dissappears.

    You have any idea? Cause I have been throwing hours and hours on this problem.