🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.language
5 messages
5 total messages Started by Henry Eck Sun, 24 Apr 2005 23:14
can't use Calendar or GregorianCalendar classes: "Hit uncaught exception java.io.FileNotFoundException"
#357
Author: Henry Eck
Date: Sun, 24 Apr 2005 23:14
29 lines
1873 bytes
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
Re: can't use Calendar or GregorianCalendar classes: "Hit uncaught exception java.io.FileNotFoundException"
#358
Author: Henry Eck
Date: Sun, 24 Apr 2005 23:54
60 lines
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
>
>
>
Re: can't use Calendar or GregorianCalendar classes: "Hit uncaught exception java.io.FileNotFoundException"
#360
Author: Lori M Olson [TeamB]
Date: Mon, 25 Apr 2005 01:17
34 lines
2225 bytes
Henry Eck wrote:

> 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 :-)
> 

Weird.

I'm not sure if this will help, but I have never used "new 
GregorianCalendar(...)" for anything.  I always use 
"Calendar.getInstance(...)".  I'm not even sure why anymore... I'm sure 
there was some good API reason back in JDK 1.1 or 1.2.

-- 

Regards,

Lori Olson [TeamB]

------------

Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.

Google Advanced Newsgroup Search
     http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
     http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
     http://www.visi.com/~gyles19/fom-serve/cache/1.html
Re: can't use Calendar or GregorianCalendar classes: "Hit uncaught exception java.io.FileNotFoundException"
#364
Author: Kevin Dean [TeamB]
Date: Mon, 25 Apr 2005 14:05
48 lines
2529 bytes
Henry Eck wrote:

> 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.

I duplicated that line of code and had no trouble.  Upload the source
file to the borland.public.attachments group and I'll take a closer
look.

-- 
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/

NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html

Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html
Re: can't use Calendar or GregorianCalendar classes: "Hit uncaught exception java.io.FileNotFoundException"
#365
Author: Shankar Unni
Date: Mon, 25 Apr 2005 15:57
23 lines
2135 bytes
Henry Eck wrote:

>     GregorianCalendar cal = new GregorianCalendar((int)(longDate/10000),
> (int)((longDate/100)%100), (int)(longDate%100));
> 
> Generates this runtime error:
> 
>     Hit uncaught exception java.io.FileNotFoundException

That's right. This is a well-known JVMDI (JVM debugging interface) bug 
in Java 1.4.x. There *is* a catch for this exception which is supposed 
to catch it, but JVMDI thinks it's uncaught.

Apparently the reason JVMDI fails is that there is a native routine on 
the stack between the throw and the catch, and it can't determine if 
that native routine will catch this exception or not, so it gives up and 
stops the process with an "uncaught" FileNotFoundException.  Even though 
there is a routine further down in the stack that *will* catch it.

When you continue, the exception is thrown and caught as usual.

Just grin and bear it, I guess. Not sure if JBuilder X or 2005 
non-foundation have options to ignore this "exception"..
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads