aspose file tools*
The moose likes Other Open Source Projects and the fly likes Resource Bundle Missing Error in iReport Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Resource Bundle Missing Error in iReport" Watch "Resource Bundle Missing Error in iReport" New topic
Author

Resource Bundle Missing Error in iReport

sami burasami
Greenhorn

Joined: Mar 05, 2009
Posts: 3
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…
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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).


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
sami burasami
Greenhorn

Joined: Mar 05, 2009
Posts: 3
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
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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

Joined: Mar 05, 2009
Posts: 3
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
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

OK, I would read this sun article and have a look at this code sample
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Resource Bundle Missing Error in iReport