serialization and IOException - please help

A

Akuma

Ok, so I have a "database" type object that basically holds just a Vector of
objects I created that hold simple text and numerical data. I use a GUI to
input the text and numerical data and want to be able to save all of the
entries. The user inputs the information, clicks a button to create an
object with the data and that object is added to the Vector. When the
program exits, the class holding the collection of objects is serialized and
saved to a file. When the program starts, that file is loaded back up so
more objects can be added to it. Now my problem is that for some reason,
after a while, something happens to my serialized file and I can't load it
back in. I get an IOException error, and the "database" class receives a
null value because the file was not loaded properly. Now my question is why
does this seem to happen? Where is the IOException coming from???

In my classes that interface with the GUI on the backend, I pass around a
reference to the Vector that holds all of the objects so I can perform
operations on it such as sorting, adding, and removing. I don't think that
is the problem since the serialization only occurs on the current status of
the Vector. Since I get no warnings or errors when performing these
operations on the Vector object, I can only assume the Vector is still
valid. So, I'm really asking where this IOException is coming from, why it
is happening, and what I can do to stop it. I serialize and save the object
following the example they gave on the Sun website and it seems to work for
a while, until the file goes bad or something. This is a very annoying
problem as I have had to re-enter alot of the data which takes a noticable
amount of time. Any help is appreciated.

Thanks a lot.
 

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

Similar Threads

Malicious Coding Help Please 5
Help please 8
Hello and Help please :-) 1
Please help 2
Please help 7
Code help please 4
HELP PLEASE 4
Please, help me. 1

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top