Somehow, it happened. I tried to make the point about fixing the zoneinfo.zip file in JavaFoundation in as simple a manner as I could. Less opportunity for mistakes, right? Wrong. :-)

I found two problems. One was my bad and the other was a bug, I think, that has been hanging around NSTimeZone for quite a while. I am much less able to find existing bug reports these days.

The first problem is that there are files in the /usr/share/zoneinfo file that do not represent time zones. They needed to be filtered out of the zip task.

The second problem is that if one goes through the list of available IDs for available time zones, some of the them fail. I was calling toString() on them and got an NPE. Not good.

The offending time zone IDs are:

        Asia/Riyadh87
        Asia/Riyadh88
        Asia/Riyadh89
        Mideast/Riyadh87
        Mideast/Riyadh88
        Mideast/Riyadh89

The "Asia/Riyadh" time zone works, but none of these other do. I think this is an existing bug, though. I just sounds too familiar.

It turns out the solution to both problems is to filter this stuff out of the zip file.

So, I am updating the project I posted. The fixFoundation target, with the excludes on the zip task, will now look like this:

    <target name="fixFoundation">
        <tempfile property="temp" />
        <mkdir dir="${temp}" />
        <unjar src="${jarfile}" dest="${temp}" />
<delete quiet="true" file="${temp}/com/webobjects/foundation/ TimeZoneInfo/zoneinfo.zip" /> <zip destfile="${temp}/com/webobjects/foundation/ TimeZoneInfo/zoneinfo.zip" basedir="${zoneInfoDir}" excludes="*.tab,**/Riyadh87,**/Riyadh88,**/Riyadh89,**/\+VERSION" />
        <move file="${jarfile}" tofile="${jarfile}_bak" />
        <jar basedir="${temp}" destfile="${jarfile}" />
        <delete quiet="true" dir="${temp}" />
    </target>

And while we are in the neighborhood, I found out that people may have more copies of the zoneinfo.zip file hanging about.

I am working with a clean install. If you have an upgraded install, you may have copies of the file that are not being used, but have not been removed.

Here is my original list:

/System/Library/Frameworks/JavaFoundation.framework/Resources/Java/ javafoundation.jar /Library/WebObjects/lib/JavaFoundation.jar (2 copies, one for WebServerResources and one for Resources) /Library/WebServer/Documents/WebObjects/Java/com/webobjects/ foundation/TimeZoneInfo/zoneinfo.zip (not in a jar file, actually)
        /Library/WebServer/Documents/WebObjects/Java/wojavaclient.jar

Here is an expanded list:

/System/Library/Frameworks/JavaFoundation.framework/Resources/Java/ javafoundation.jar /System/Library/Frameworks/JavaFoundation.framework/ WebServerResources/Java/JavaFoundation.jar /System/Library/Frameworks/JavaFoundation.framework/ WebServerResources/Java/com/webobjects/foundation/TimeZoneInfo/ zoneinfo.zip /System/Library/Frameworks/JavaEODistribution.framework/Versions/A/ WebServerResources/Java/wojavaclient.jar /System/Library/WebObjects/WODocumentRoot/WebObjects/Java/ JavaFoundation.jar /System/Library/WebObjects/WODocumentRoot/WebObjects/Java/ wojavaclient.jar /System/Library/WebObjects/WODocumentRoot/WebObjects/Java/com/ webobjects/foundation/TimeZoneInfo/zoneinfo.zip
        /System/Library/Java/wojavaclient.jar
        /Library/WebObjects/lib/JavaFoundation.jar
        /Library/WebServer/Documents/WebObjects/Java/JavaFoundation.jar
        /Library/WebServer/Documents/WebObjects/Java/wojavaclient.jar
/Library/WebServer/Documents/WebObjects/Java/com/webobjects/ foundation/TimeZoneInfo/zoneinfo.zip

Yikes!

- ray


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to