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 :
Founder of Mkyong.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 making a donation to the charity, thanks.

Related Posts

Popular Posts