LocalizationBundle

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
apete

LocalizationBundle

Post by apete » Wed Jan 21, 2004 12:19 pm

Hi,

I have previously drawn simple pie charts. Now I'm trying to draw a stacked area chart. I get a java.lang.ExceptionInInitializerError caused by an java.util.MissingResourceException on locale en_US.

I've never worked with localisation in any way before. If a particular set is missing shouldn't the code revert to using some default values?

I did try to create a LocalizationBundle_en_US.properties file (copied LocalizationBundle.properties) but this didn't matter.

I'm using JFreeChart 0.0.16.

/Anders

[2004-01-21 11:34:47 CET] <WorkerThread2> <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request:
com.webobjects.foundation.NSForwardException [java.lang.ExceptionInInitializerError] null
[2004-01-21 11:34:47 CET] <WorkerThread2> com.webobjects.foundation.NSForwardException for java.lang.ExceptionInInitializerError
at org.jfree.chart.ChartFactory.createXYAreaChart(ChartFactory.java:868)
at se.optimatika.wo5.chart.DefaultTableXYFactory.getChart(DefaultTableXYFactory.java:85)
at CpStdChart.getImageData(CpStdChart.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
...
Caused by: java.util.MissingResourceException: Can't find bundle for base name org.jfree.chart.plot.LocalizationBundle, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:804)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:511)
at org.jfree.chart.plot.XYPlot.<clinit>(XYPlot.java:209)
... 40 more

mjacobsca
Posts: 16
Joined: Thu Aug 21, 2003 4:59 pm

I'm Getting It Too

Post by mjacobsca » Wed Jan 21, 2004 5:43 pm

I'm getting the same error. I rebuild the JAR file to add a few minor convenience methods.

I am using Windows 2000
JDK 1.3.1_02
JFreeChart 0.9.16
JCommon 0.9.1

All old files have been removed from my classpath.

Michael

mjacobsca
Posts: 16
Joined: Thu Aug 21, 2003 4:59 pm

Problem Fixed

Post by mjacobsca » Wed Jan 21, 2004 5:50 pm

My Java editor wasn't including *.properties files in the final JAR build. Once I included these, my problem went away. So this was user error.

If you are rebuilding your jar, make sure these files are in it after you build it.

Michael

apete

Thanks

Post by apete » Wed Jan 21, 2004 7:18 pm

That was it! /Anders

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Jan 21, 2004 11:32 pm

There is an Ant script in the distribution which will rebuild the jar files and automatically include the resource files.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked