Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

creating java class resource bundle  RSS feed

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the OCP Book by Jeanne Boyarsky and Scott Selikoff, the following code is given as an example of class resource bunde :

however, when I run it here is what I get :

Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name Tax, locale en_US

.
Does anyone know what I miss
 
Sheriff
Posts: 23640
48
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was your class "Taxt_en_US" meant to be the resource bundle for "Tax"? The spelling of that name explains why it can't be found.
 
yas sine
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeep, the class Tax_en_US is meant to be the resource bundle, however, I don't see what is wrong with the class name, In the book it is said that it must have this form : "ClassName_Language_Country" ..., Am I wrong ??
 
Paul Clapham
Sheriff
Posts: 23640
48
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

yas sine wrote:yeep, the class Tax_en_US is meant to be the resource bundle, however, I don't see what is wrong with the class name



You didn't call the class "Tax_en_US". Look again at what you did call it.
 
yas sine
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ohh yeah, I made a mistake, however, I still get the same error :


Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name Tax, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:845)
at Chap5.Tax_en_US.main(Taxt_en_US.java:17)


here is the class code :
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!