• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resource Bundle Error

 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why should i get error for example 1:C:\>java Resrf
Exception in thread "main" java.util.MissingResourceException: Can't find bundle
for base name config.properties, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source
)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at Resrf.main(Resrf.java:8)

import java.util.*;


and no error for example2:
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the exact name of the Resource? Is it config, or config.properties?
 
Phillipe Rodrigues
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the file is actually a properties file(config.properties)

when if specify base name "config.properties" as in example1 i start getting error,but when i specify it as "config" the code executes successfully.Why is it so?resource should only be a properties file?
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know, I am afraid, and I don't think this API link helps a lot. Sorry.

Anybody else?
 
karthikeyan Chockalingam
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A short tutorial explaining this.

http://theasolutions.com/java_rbundle.jsp
[ May 19, 2008: Message edited by: karthi keyan ]
 
Rohan Kalbhor
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
make sure your specified path is correct and if the '.properties' file is present in a specific folder make sure you access the file as
folder_name.filename.properties
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic