Technical FAQ: General questions about Java
FAQ Index
StackOverflowException
When sending a message between client and server I received a
StackOverflowException. What's going on?
If you are sending a particularly large data structure using
java.io.Serialization, you may exceed the per-thread size limit for
either the Java or native stack. You can increase the stack size by
using the following command line options:
- -ss Stacksize to
increase the native stack size or
- -oss Stacksize
to increase the Java stack size,
where Stacksize is expressed as an integer followed by "k"
or "m" for kbytes or mbytes. For example,
-
$java -ss156k (native)
$java -oss600k (Java)
The default native stack size is 128k, with a minimum value of
1000 bytes. The default java stack size is 400k, with a minimum
value of 1000 bytes.
Problems reading jar files with ZipFile
I am trying to read some jar
files but the following exception is thrown:
java.io.EOFException:Unexpected end of ZLIB input
stream.
I used JDK 1.1.x
to jar the files.
There is a bug in JDK 1.1.x which causes the ZipFile class to read
beyond the end-of-file. JavaSoft recommends the following workaround:
- Do not attempt to read more bytes than the entry
contains. Call
ZipEntry.getSize() to get the actual size of the entry and use
that value to keep track of the remaining number of bytes while
reading the entry. There is additional information available from the
JavaSoft Bug Parade.
