getting stackoverflow error when using ObjectInputStream

Discussion in 'Java' started by Efrat Ben-David, Sep 26, 2004.

  1. 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
     
    Efrat Ben-David, Sep 26, 2004
    #1
    1. Advertising

  2. On 26 Sep 2004 06:14:37 -0700, Efrat Ben-David <>
    wrote:

    > 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
    -Xss<size> set java thread stack size
    This might be helpful

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

    --

    Whom the gods wish to destroy they first call promising.
     
    Stefan Schulz, Sep 26, 2004
    #2
    1. Advertising

  3. On 26 Sep 2004 06:14:37 -0700, Efrat Ben-David wrote:

    > 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) <http://www.physci.org/codes/javafaq.jsp#exact>

    >..(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) <http://www.physci.org/codes/sscce.jsp>

    > 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
     
    Andrew Thompson, Sep 26, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rob Meade

    Visual Studio: StackOverflow

    Rob Meade, Oct 26, 2005, in forum: ASP .Net
    Replies:
    23
    Views:
    8,373
    Rob Meade
    Nov 6, 2005
  2. Bryan Castillo

    StackOverflow Exception in JNI

    Bryan Castillo, Jun 10, 2004, in forum: Java
    Replies:
    6
    Views:
    5,234
    Gordon Beaton
    Jun 11, 2004
  3. sravan
    Replies:
    2
    Views:
    1,440
    Alan Moore
    Sep 3, 2004
  4. Elhanan
    Replies:
    1
    Views:
    636
    Elhanan
    May 10, 2006
  5. Replies:
    3
    Views:
    1,035
    Arne Vajhøj
    Nov 2, 2009
Loading...

Share This Page