Bug 32486 - ResourceBundle/properties resolution
Summary: ResourceBundle/properties resolution
Status: UNCONFIRMED
Alias: None
Product: classpath
Classification: Unclassified
Component: classpath (show other bugs)
Version: unspecified
: P3 normal
Target Milestone: 0.97
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 34713 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-06-24 19:25 UTC by Andrew John Hughes
Modified: 2008-02-28 15:27 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Testcase (243 bytes, text/x-java)
2008-02-21 20:30 UTC, Andrew John Hughes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew John Hughes 2007-06-24 19:25:22 UTC
Trying to build gcj with the GNU Classpath jar tool falls over the following bug in our properties/locale system:

        find gnu java javax org sun -name .svn -prune -o -name '*.class' -print | \
        jar -cfM@ $here/libgcj-4.3.0.jar
jar: internal error:
java.util.MissingResourceException: Key 'minNumberOfDaysInFirstWeek'not found in Bundle: gnu.java.locale.LocaleInformation_en_GB
   at java.util.ResourceBundle.getObject(ResourceBundle.java:187)
   at java.util.Calendar.<init>(Calendar.java:509)
   at java.util.GregorianCalendar.<init>(GregorianCalendar.java:237)
   at java.util.GregorianCalendar.<init>(GregorianCalendar.java:224)
   at java.util.Calendar.getInstance(Calendar.java:612)
   at java.util.Calendar.getInstance(Calendar.java:538)
   at java.util.zip.ZipEntry.getCalendar(ZipEntry.java:225)
   at java.util.zip.ZipEntry.setTime(ZipEntry.java:172)
   at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:222)
   at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:111)
   at gnu.classpath.tools.jar.Creator.writeFile(Creator.java:116)
   at gnu.classpath.tools.jar.Creator.writeFile(Creator.java:154)
   at gnu.classpath.tools.jar.Creator.writeCommandLineEntries(Creator.java:203)
   at gnu.classpath.tools.jar.Creator.writeCommandLineEntries(Creator.java:229)
   at gnu.classpath.tools.jar.Creator.run(Creator.java:246)
   at gnu.classpath.tools.jar.Main.run(Main.java:276)
   at gnu.classpath.tools.jar.Main.main(Main.java:284)

We should search further up the tree for this key, which indeed isn't in the en_GB properties file but there is a default further up which I assume we should rely on.  The java.util.ResourceBundle docs describe a parent chain that I can't see us implementing from the code.
Comment 1 wlarip 2007-09-14 14:34:35 UTC
(In reply to comment #0)
> Trying to build gcj with the GNU Classpath jar tool falls over the following
> bug in our properties/locale system:
>         find gnu java javax org sun -name .svn -prune -o -name '*.class' -print
> | \
>         jar -cfM@ $here/libgcj-4.3.0.jar
> jar: internal error:
> java.util.MissingResourceException: Key 'minNumberOfDaysInFirstWeek'not found
> in Bundle: gnu.java.locale.LocaleInformation_en_GB
>    at java.util.ResourceBundle.getObject(ResourceBundle.java:187)
>    at java.util.Calendar.<init>(Calendar.java:509)
>    at java.util.GregorianCalendar.<init>(GregorianCalendar.java:237)
>    at java.util.GregorianCalendar.<init>(GregorianCalendar.java:224)
>    at java.util.Calendar.getInstance(Calendar.java:612)
>    at java.util.Calendar.getInstance(Calendar.java:538)
>    at java.util.zip.ZipEntry.getCalendar(ZipEntry.java:225)
>    at java.util.zip.ZipEntry.setTime(ZipEntry.java:172)
>    at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:222)
>    at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:111)
>    at gnu.classpath.tools.jar.Creator.writeFile(Creator.java:116)
>    at gnu.classpath.tools.jar.Creator.writeFile(Creator.java:154)
>    at gnu.classpath.tools.jar.Creator.writeCommandLineEntries(Creator.java:203)
>    at gnu.classpath.tools.jar.Creator.writeCommandLineEntries(Creator.java:229)
>    at gnu.classpath.tools.jar.Creator.run(Creator.java:246)
>    at gnu.classpath.tools.jar.Main.run(Main.java:276)
>    at gnu.classpath.tools.jar.Main.main(Main.java:284)
> We should search further up the tree for this key, which indeed isn't in the
> en_GB properties file but there is a default further up which I assume we
> should rely on.  The java.util.ResourceBundle docs describe a parent chain that
> I can't see us implementing from the code.

same problem exists trying to compile KJC java compiler with Jikes against
GNU classpath 0.93.

this appears to be a problem in classpath.

this is for confirmation only. 
Comment 2 Andrew John Hughes 2008-02-20 21:14:01 UTC
*** Bug 34713 has been marked as a duplicate of this bug. ***
Comment 3 Andrew John Hughes 2008-02-21 20:30:11 UTC
Created attachment 15198 [details]
Testcase
Comment 4 Andrew John Hughes 2008-02-21 20:31:14 UTC
I can't seem to replicate this with the attached testcase.  Closing for now as working, but I'll reopen this again if I fail when building gcj.  I have a feeling it may be using an old Classpath (e.g. in gij) to run jar.
Comment 5 Andrew John Hughes 2008-02-28 14:00:15 UTC
Reopening.  I still can't get this down to a minimal testcase but gcj is still not building with gjar:

here=`pwd`; cd /var/tmp/portage/dev-java/gcj-4.3.0_alpha20071207/work/gcc-4.3-20071207/libjava/classpath/lib; \
        find gnu java javax org sun -name .svn -prune -o -name '*.class' -print | \
        jar -cfM@ $here/libgcj-4.3.0-alpha20071207.jar
Adding entry: gnu/awt/j2d/IntegerGraphicsState.class
gnu.java.locale.LocaleInformation_en_US@10170ac8
jar: internal error:
java.util.MissingResourceException: Key 'minNumberOfDaysInFirstWeek'not found in Bundle: gnu.java.locale.LocaleInformation_en_US
   at java.util.ResourceBundle.getObject(ResourceBundle.java:187)
   at java.util.Calendar.<init>(Calendar.java:510)
   at java.util.GregorianCalendar.<init>(GregorianCalendar.java:237)
   at java.util.GregorianCalendar.<init>(GregorianCalendar.java:224)
   at java.util.Calendar.getInstance(Calendar.java:613)
   at java.util.Calendar.getInstance(Calendar.java:539)
   at java.util.zip.ZipEntry.getCalendar(ZipEntry.java:225)
   at java.util.zip.ZipEntry.setTime(ZipEntry.java:172)
   at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:222)
   at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:111)
   at gnu.classpath.tools.jar.Creator.writeFile(Creator.java:116)
   at gnu.classpath.tools.jar.Creator.writeFile(Creator.java:154)
   at gnu.classpath.tools.jar.Creator.writeCommandLineEntries(Creator.java:203)
   at gnu.classpath.tools.jar.Creator.writeCommandLineEntries(Creator.java:229)
   at gnu.classpath.tools.jar.Creator.run(Creator.java:246)
   at gnu.classpath.tools.jar.Main.run(Main.java:276)
   at gnu.classpath.tools.jar.Main.main(Main.java:284)
Comment 6 Andrew John Hughes 2008-02-28 14:55:54 UTC
I've finally managed to diagnose this.  The problem is the way the properties are being loaded.  When compressing the files in gcj's lib directory, compiled gnu.java.locale.LocaleInformation* classes from libgcj are available on the classpath.  As classes are preferred over properties files, gjar tries to use these and fails because they don't contain the same information as the Classpath ones.

There are two problems:

1. GNU Classpath is prone to compromise from data on the classpath
2. GCJ is still bundling old outdated locale data.
Comment 7 Andrew John Hughes 2008-02-28 15:27:27 UTC
Classloader: java.lang.ClassLoader$1{urls=[file:/var/tmp/portage/dev-java/gcj-4.3.0_alpha20071207/work/gcc-4.3-20071207/libjava/classpath/lib/./], parent=null}

So this is definitely the problem, but what's the solution?