properties problem

0
hello i have a repport with .properties .
under ireport no problem to use the properties.
but under java and jasperreport it does not find me the file properties

error:
“Can't find bundle for base name liste_anniversaire, locale fr_CH"


my files .jasper and .properties are in the same file

thank you in advance
lazzer's picture
1
Joined: Aug 2 2006 - 5:12pm
Last seen: 15 years 5 months ago

3 Answers:

0

Hi,

I am facing the same issue described above, i can get it to work from iReport but when i try to do the same at runtime from the web application i get that "Can't find bundle for base name..." error

The .properties files are in the same location as the .jrxml

I am setting the locale by passing the REPORT_LOCALE parameter, i tried by passing the resource bundle directly without any luck.

i also tried by setting the report classpath pointing to the source folder.

 

I'm completly lost in this point. 

Can anybody help me.

Thanks in advance.

 

Zeva.

 

zeva's picture
3
Joined: Dec 9 2009 - 12:17pm
Last seen: 12 years 1 month ago
0

The Web Application is looking for the ResourceBundle in it's CLASSPATH;

The CLASSPATH of a WebApplication is relative to the WEB-INF folder. So you may try to place your properties file(s)  in the WEB-INF folder.

Or you could pass a custom classloader to the JasperFillManager. You can do this from any Java Application (not necessarily a web application).This way it doesn't matter where you keep your properties files as long as you let the fill manager know where to look for them on disk.

Hope that helps

Code:
            URL[] url = {new File("D:/propertiesFolder/").toURL()};
            URLClassLoader loader = new URLClassLoader(url);
            params.put("REPORT_CLASS_LOADER",loader);
            JasperPrint print = JasperFillManager.fillReport(is,params,connection);
</td></tr></tbody></table>
spera's picture
20
Joined: Jul 23 2009 - 3:31am
Last seen: 12 years 6 months ago
0

Perfect!!! That's what i needed. It works!

Thanks for your quick reply spera!!

zeva's picture
3
Joined: Dec 9 2009 - 12:17pm
Last seen: 12 years 1 month ago
Feedback