Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Resource Bundle Missing Error in iReport

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am Facing serious problem with base resource bundle error.
I have to translate the report as per requirement from one language to another by choosing locale. So I have created a properties file for each language such as xxxx_de_DE, xxxx_en_US.. etc .. I have place this files along with my jasper files in a location.
My report is running fine while I am running from iReport3.1.. but when I try to run through my java application its gives the following error..


java.util.MissingResourceException: Can't find bundle for base name invoice_header_backup, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:837)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:727)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:700)
at net.sf.jasperreports.engine.util.JRResourcesUtil.loadResourceBundle(JRResourcesUtil.java:572)
at net.sf.jasperreports.engine.util.JRResourcesUtil.loadResourceBundle(JRResourcesUtil.java:510)
at net.sf.jasperreports.engine.fill.JRFillDataset.loadResourceBundle(JRFillDataset.java:527).


i have tried a lot more over this issue.. but I can’t able overcome this problem.. any please suggest me.. how to overcome this problem.. thanks in advance…
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there and welcome to Javaranch!

How are you reading in the ResourceBundle and where is that ResourceBundle stored? It sounds like its a typical CLASSPATH issue (the ResourceBundle must be on the CLASSPATH of your Java application if yuo're using the fairly standard way of retrieving them).
 
sami burasami
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You for your reply...
i am run the jasper report through my java application.
for example.
i have stored my *.jasper files in C:\jasper\ location. and also i have place my *_en_US.properties file in that location...
for my jasper file i have given some path in my class file.. like the following



whether i have to give any path for this properties also?
if its how can i give the path for properties file...

thanks in advance..
 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint: You want to look at the method called getResourceAsStream(). You probably also want to avoid having absolute paths that are dependent on one server (e.g. Not every server will have c:\, especially non windows ones!).
 
sami burasami
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks For your reply.
for your understand only i have stated like that path.. but i am using the class for find that file..
sorry i can't get your hint which you stated as


can you explain little bit more. regarding how can get that *_en_US file and how can i pass that file to my jasper file.
 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I would read this sun article and have a look at this code sample
 
The human mind is a dangerous plaything. This tiny ad is pretty safe:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!