Article View: borland.public.jbuilder.java.language
Article #358Re: can't use Calendar or GregorianCalendar classes: "Hit uncaught exception java.io.FileNotFoundException"
From: Henry Eck
Date: Sun, 24 Apr 2005 23:54
Date: Sun, 24 Apr 2005 23:54
60 lines
2594 bytes
2594 bytes
A little more info.. I found that if I enclose the whole thing in a try
{}catch{}, then it seems to work, in spite of the exception.
I'm still not very comfortable using this with financial data, so any help
or insight about the exception would be appreciated :-)
// returns 1=Sunday ... 7 = Saturday
static public int dayOfWeek (long longDate) {
int dayOfWeek = 0;
try {
GregorianCalendar cal = new GregorianCalendar((int)(longDate/10000),
(int)((longDate/100)%100)-1, (int)(longDate%100));
dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); // 2=Monday
}
catch (Exception e) {}
return(dayOfWeek);
}
"Henry Eck" <h_eck@yahoo.com> wrote in message
news:426c283f$1@newsgroups.borland.com...
> I am using JBuilder X developer, but also saw similar problems with
JBuilder
> 9 personal.
>
> This line of code:
>
> GregorianCalendar cal = new GregorianCalendar((int)(longDate/10000),
> (int)((longDate/100)%100), (int)(longDate%100));
>
> Generates this runtime error:
>
> Hit uncaught exception java.io.FileNotFoundException
>
>
> The same thing happens with SimpleDateFormat.
>
> I have attached a "stack" trace as a screen shot (gif file). It looks to
me
> like it can't find a zoneInfoFile which it is trying to get from Sun. (?)
>
> (oops it won't let me attach the file). I can email it to anyone who is
> willing to take a look.
>
> By the way, I am fairly sure this is not an install problem as it happens
> quite reliably, even after reinstalling both of the aforementioned
versions
> of java.
>
> Any help will be appreciated, as this is causing me a lot of problems.
> Thanks.
>
> Henry
>
>
>
Technical Details
Message-ID:
<426c31c3@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<426c283f$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,dc24d52afc8ec5c1 X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Henry Eck" <h_eck@yahoo.com> Newsgroups: borland.public.jbuilder.java.language References: <426c283f$1@newsgroups.borland.com> Subject: Re: can't use Calendar or GregorianCalendar classes: "Hit uncaught exception java.io.FileNotFoundException" Date: Sun, 24 Apr 2005 19:54:29 -0400 Lines: 62 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 NNTP-Posting-Host: 24.98.38.152 Message-ID: <426c31c3@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1114386883 24.98.38.152 (24 Apr 2005 16:54:43 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail