1

I am quite new to intellij and i have loaded in a project that i wish to compile, everything seems to be going well, but when i compile it. I get the bundle cannot be found.

java.util.MissingResourceException: Can't find bundle for base name openfire_i18n, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)

After doing some investigation, it appears i have to include the resources in the class path, is this correct?

I have done Project Settings, Modules, Dependencies, and i added a "Jars or directories"

There is a checkbox that says Export, i have tried clicking it and unclicking it :-)

My resources i can see are in

i8n\ResourceBundle

I tried adding the i8n and it asked me for a category for selected files, i put classes

RUN - but still same error..

so i tried adding the i8n/ResourceBundle directory

RUN - still same error.

I notice under my ResourceBundle directory there are

C:\Dev\Java\openfire_src_3_7_1\openfire_src\src\i18n\openfire_i18n_en.properties

but there is no specific en_US but i thought it supposed to fallback to EN ??

SO i think everything is ok.

Can anyone help

I am really stuck

Thanks

EDIT

I also notice that under propeties and COMPILER i have the following, so should it just include these files?

?*.properties;?*.xml;?*.gif;?*.png;?*.jpeg;?*.jpg;?*.html;?*.dtd;?*.tld;?*.ftl

MORE INFO

I have just added this file where all the others are but same error

C:\Dev\Java\openfire_src_3_7_1\openfire_src\src\i18n\openfire_i18n_en_US.properties

DEBUG

Below is the line "ResourceBundle bundle = ResourceBundle.getBundle(resourceBaseName, locale);" and this is where it errors.

locale = en_US

and

resourceBaseName = openfire_i18n

Locale locale = JiveGlobals.getLocale();

ResourceBundle bundle = ResourceBundle.getBundle(resourceBaseName, locale);

return getLocalizedString(key, locale, null, bundle);
Martin
  • 23,844
  • 55
  • 201
  • 327

4 Answers4

1

You should define openfire_src\src\i18n directory as Sources in the Module Sources tab settings, so that .properties files appear in the output root directory (and in the default package of the classpath).

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
0

As an addendum to CrazyCoder: The resource should be a Source Folder. It cannot be a Test Source Folder.

Somaiah Kumbera
  • 7,063
  • 4
  • 43
  • 44
0

I resolved same issue during setup openfire 3.9

you need to perform following task..

Open 'Run Configuration' click on 'classpath' tab then in 'Advanced' select 'Add folders' then select 'i18n' from openfire/src/

follow same process and Add 'jar' folder from openfire/src/resources and 'dist' folder from openfire/build/lib

enter image description here

Vivek Buddhadev
  • 843
  • 1
  • 8
  • 9
0

In newer versions of intelliJ you can right-click and select "Mark directory as">"Resources root". Explained in more detail here.

EmmanuelMess
  • 1,025
  • 2
  • 17
  • 31