Welcome to Dream.In.Code
Become a Java Expert!

Join 149,507 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,343 people online right now. Registration is fast and FREE... Join Now!




Exception while writing to the file(Very Urgent)

 
Reply to this topicStart new topic

Exception while writing to the file(Very Urgent), Cannot write last row into file,HOMEWORK problem

swapnasandela
17 Aug, 2007 - 12:38 AM
Post #1

New D.I.C Head
*

Joined: 30 Jul, 2007
Posts: 8


My Contributions
TREE NODE :H'3E LEFT:H'227 RIGHT:H'227

TREE NODE :H'3C LEFT:H'227 RIGHT:H'227

TREE NODE :H'39 LEFT:H'38 RIGHT:H'3A

dbtab4.tst (Too many open files)
TREE NODE :H'3A LEFT:H'227 RIGHT:H'

Exception in thread "main" java.lang.NumberFormatException:
at java.lang.Integer.parseInt(Integer.java:435)
at graphanalyzetool1.writeBtreetoFile(graphanalyzetool1.java:1084)
at graphanalyzetool1.main(graphanalyzetool1.java:62)

While writing data to file at the last row it is throwing the above exception.
Some one please help me in this regard..Struggling from one week.

This post has been edited by alcdotcom: 17 Aug, 2007 - 06:33 AM
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Exception While Writing To The File(Very Urgent)
17 Aug, 2007 - 02:08 AM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,303



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
In order for someone to be able to help you, you are going to need to post the code. Just providing the error message that you are getting does provide enough insight into why you are getting this error message.
User is offlineProfile CardPM
+Quote Post

swapnasandela
RE: Exception While Writing To The File(Very Urgent)
17 Aug, 2007 - 03:01 AM
Post #3

New D.I.C Head
*

Joined: 30 Jul, 2007
Posts: 8


My Contributions
QUOTE(jayman9 @ 17 Aug, 2007 - 03:08 AM) *

In order for someone to be able to help you, you are going to need to post the code. Just providing the error message that you are getting does provide enough insight into why you are getting this error message.



Hi,

I am attaching the code
User is offlineProfile CardPM
+Quote Post

Programmist
RE: Exception While Writing To The File(Very Urgent)
17 Aug, 2007 - 06:43 AM
Post #4

Four-letter word
Group Icon

Joined: 2 Jan, 2006
Posts: 1,250



Thanked: 11 times
Dream Kudos: 100
Expert In: Java

My Contributions
First of all, this is a beginner topic and I've marked it as such. Second, I've closed your other duplicate topics (there were two!). It's against the rules to make duplicate posts. Plus it's annoying, and will not get you help any faster. Third, you didn't attach any code, but lucky for you the stack trace is very easy to read:

QUOTE
Exception in thread "main" java.lang.NumberFormatException:
at java.lang.Integer.parseInt(Integer.java:435)
at graphanalyzetool1.writeBtreetoFile(graphanalyzetool1.java:1084)
at graphanalyzetool1.main(graphanalyzetool1.java:62)


The first line tells you that it's a NumberFormatException. The second line tells you where it happened: at java.lang.Integer.parseInt(Integer.java:435). You are trying to call parseInt on a value that cannot be turned into an integer. Put a breakpoint before this line and run a debugger to see what you are trying to pass into that method. If you don't know how to use a debugger, print the value out to the console (std out) to see what you are passing to the parseInt method. Here's an example of different values that you might pass to parseInt and their results


int y = Integer.parseInt(x); // x is a String

if x == "5" then y == 5

if x == " 5" then NumberFormatException is thrown
There's an extra space, which can't be converted to a number

if x == "#" then NumberFormatException is thrown
How can you convert "#" to a number?

This post has been edited by alcdotcom: 17 Aug, 2007 - 06:48 AM
User is offlineProfile CardPM
+Quote Post

swapnasandela
RE: Exception While Writing To The File(Very Urgent)
20 Aug, 2007 - 04:15 AM
Post #5

New D.I.C Head
*

Joined: 30 Jul, 2007
Posts: 8


My Contributions
Hello,

Have you read my query till end.because after fetching some number of rows I am getting the error "TOO MANY FILES OPEN".

I can trace the other part.Just want the info about TOO MANY FILES OPEN Error ,even I have closed all opened files
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Exception While Writing To The File(Very Urgent)
20 Aug, 2007 - 04:36 AM
Post #6

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
just post the code inside of [code] blocks and we can help you out a lot easier... also sometimes fixing some of the small errors also eliminates the large ones.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 07:10PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month