Jump to content
Changes to the Jaspersoft community edition download ×

Problem with the resourceBundle file


Recommended Posts

By: BogdanGH - bogdangh

Problem with the resourceBundle file

2006-07-20 06:51

Hi,

i have a report named market_price.jrxml and i want to have the text internationalized. So i added the prop file market_price.properties (and the *_en.properties and the *_en_US.properties) in the same directory as the jrxml file. All files are copied in WAR yet when i try to execute the report, i get :

java.util.MissingResourceException: Can't find bundle for base name market_price, 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.fill.JRFillDataset.loadResourceBundle(JRFillDataset.java:526)

at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:557)

at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:878)

at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:689)

at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:666)

at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:89)

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601)

at com.transbility.web.report.ReportResult.createReport(ReportResult.java:169)

at com.transbility.web.report.ReportResult.doExecute(ReportResult.java:212)

..

..

..

 

i've set the defaultLocale as Default and ResourceBundle as market_price:

<jasperReport name="MarketPrice" pageWidth="1000" pageHeight="595" orientation="Landscape" columnWidth="1000" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" resourceBundle="market_price" whenResourceMissingType="Empty">

 

what do i do wrong to get the exception ?

 

Thanks for any help.

 

 

By: Lucian Chirita - lucianc

RE: Problem with the resourceBundle file

2006-07-21 05:14

Resource bundles are loaded as classloader resources (via the standard java.util.ResourceBundle), therefore you need to place the *.properties files somewhere on your application's classpath (e.g. under WEB-INF/classes or inside a jar under WEB-INF/lib).

 

HTH,

Lucian

 

 

By: BogdanGH - bogdangh

RE: Problem with the resourceBundle file

2006-07-21 07:30

I've put the prop files in WEB-INF/classes and it works.

Under /classes i have /reports/subreports and until now the prop files were in /subreports folder, with the jrxml-s. Seems that isn't good.

 

Thank you.

 

Bogdan

 

 

By: Lucian Chirita - lucianc

RE: Problem with the resourceBundle file

2006-07-21 07:39

You can leave them under class/reports/subreports and set resourceBundle="reports.subreports.market_price".

 

Lucian

 

 

By: BogdanGH - bogdangh

RE: Problem with the resourceBundle file

2006-07-24 01:10

That works even better. Thank you.

 

Bogdan

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...