getting stackoverflow error when using ObjectInputStream

E

Efrat Ben-David

Hi
I'm using ObjectOutputStream & ObjectInputStream to write a hashtable
object from the memory into a dat file and to read the object from a
dat file.
I have no problem writting the object to the file but when I try to
read the object from the file I get stack over flow error (it doesn't
happen when I try to read in debug mode)
what should I do?
is there another way to write and read hashtable abject from a file?
Thx
Efrat Ben David
 
S

Stefan Schulz

I have no problem writting the object to the file but when I try to
read the object from the file I get stack over flow error (it doesn't
happen when I try to read in debug mode)

Maybe your debugger allocates a larger Stack to each Thread? You can try
playing with the StackSize for your JVM, but this is not what i would
consider a "solid" solution to your problem.

From java -X
what should I do?

Post an example to show where exactly your code fails. Maybe there
is some simple solution to it all.
is there another way to write and read hashtable abject from a file?

This depends. What are they keys and values of the table? If it is easy
to transform them too and from String, you might actually be much better
off just saving them in some appropriate format (XML?) and then parsing
this file again.
 
A

Andrew Thompson

I have no problem writting the object to the file but when I try to
read the object from the file I get stack over flow error

a) said:
..(it doesn't
happen when I try to read in debug mode)

At which line line of the source you did not supply
is the exception or error occurring?
b) said:
what should I do?

See a), then supply b).

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top