Error in properties file configuration

Asked

Viewed 235 times

0

I am trying to set up a properties file. I followed some tutorials but unsuccessfully. I am with the following error:

Caused by: java.util.Missingresourceexception: Can’t find Bundle for base name src.main.Resources.properties.messages, locale en

My faces-config file is like this:

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
    version="2.2">
    <application>
        <locale-config>
            <default-locale>pt</default-locale>
            <!-- <supported-locale>en</supported-locale> -->
        </locale-config>
        <resource-bundle>
            <base-name>src.main.resources.properties.mensagens</base-name>
            <var>msg</var>
        </resource-bundle>
    </application>
</faces-config>

Someone knows how I fix it?

  • <!-- <supported-locale>en</supported-locale> --> <!-- <supported-locale>pt</supported-locale> -> may be something here Naum, in a java manjo, but by error it may be a path

  • <The "default-locale" element declares the default locale for this application instance. </p> <p>It must be specified as :language:[:country:[:Variant:]] without the colons, for example "ja_JP_SJIS". The separators between the Segments may be '-' or '_'. </p> other path http://www.mkyong.com/jsf2/cant-find-bundle-for-base-name-xxx-locale-en_us/

  • Did not resolve :(

  • Putz is as much as I could help. GL

1 answer

0


After breaking my head a lot and testing here and there, I left in my faces-config.xml the chunk of the file path so:

<base-name>properties.mensagens</base-name>

Didn’t need to pass the whole name.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.