Java Runtime errors

Core environment and runtime library

https://java.com
Solution coverage:
Summary coverage:

Top patterns

  1. Unable to open file, file not found in the path provided

    Use the relative path when providing the location of the file. Place the file in the project folder and access it according to the hierarchy. If you want to access a file outside the project folder, provide the absolute path.

  2. Trying to write an object to a file/socket that is not serializable

    To ensure that you are able to write an object to a file/socket, make the object's class implement the Serializable interface

  3. JRE unable to create file

    There could be quite a few reasons for this, check:

    • If the directory, in which the file is located, exists.
    • Whether you have write permissions for the file.
    • Whether you have directory write permissions.
    • Whether you have too many file handles open.

DescriptionException TypeEntry MethodWeb pages

Unable to open file, file not found in the path provided

java.io.FileNotFoundException
java.io.FileInputStream.open
3537Web pages
1Solution
FileNotFoundExceptionFileInputStream.open3537

Trying to write an object to a file/socket that is not serializable

java.io.NotSerializableException
java.io.ObjectOutputStream.writeObject0
1375Web pages
1Solution
NotSerializableExceptionObjectOutputStream.writeObject01375

JRE unable to create file

java.io.IOException
java.io.UnixFileSystem.createFileExclusively
710Web pages
1Solution
IOExceptionUnixFileSystem.createFileExclusively710

Unable to create/append to file

java.io.FileNotFoundException
java.io.FileOutputStream.open0
699Web pages
1Solution
FileNotFoundExceptionFileOutputStream.open0699

File.<init>() has thrown a NullPointerException

java.lang.NullPointerException
java.io.File.<init>
619Web pages
NullPointerExceptionFile.<init>619

ObjectInputStream.readStreamHeader() has thrown a StreamCorruptedException

java.io.StreamCorruptedException
java.io.ObjectInputStream.readStreamHeader
552Web pages
1Solution
StreamCorruptedExceptionObjectInputStream.readStreamHeader552

FileOutputStream.writeBytes() has thrown an IOException

java.io.IOException
java.io.FileOutputStream.writeBytes
493Web pages
IOExceptionFileOutputStream.writeBytes493

DataInputStream.readInt() has thrown an EOFException

java.io.EOFException
java.io.DataInputStream.readInt
437Web pages
EOFExceptionDataInputStream.readInt437

ObjectStreamClass.initNonProxy() has thrown an InvalidClassException

java.io.InvalidClassException
java.io.ObjectStreamClass.initNonProxy
435Web pages
InvalidClassExceptionObjectStreamClass.initNonProxy435

File.<init>() has thrown an IllegalArgumentException

java.lang.IllegalArgumentException
java.io.File.<init>
409Web pages
IllegalArgumentExceptionFile.<init>409

Reader.<init>() has thrown a NullPointerException

java.lang.NullPointerException
java.io.Reader.<init>
392Web pages
NullPointerExceptionReader.<init>392

RandomAccessFile.open() has thrown a FileNotFoundException

java.io.FileNotFoundException
java.io.RandomAccessFile.open
387Web pages
FileNotFoundExceptionRandomAccessFile.open387

ObjectInputStream$PeekInputStream.readFully() has thrown an EOFException

java.io.EOFException
java.io.ObjectInputStream$PeekInputStream.readFully
381Web pages
EOFExceptionObjectInputStream$PeekInputStream.readFully381

ObjectInputStream$BlockDataInputStream.peekByte() has thrown an EOFException

java.io.EOFException
java.io.ObjectInputStream$BlockDataInputStream.peekByte
366Web pages
EOFExceptionObjectInputStream$BlockDataInputStream.peekByte366

DataInputStream.readFully() has thrown an EOFException

java.io.EOFException
java.io.DataInputStream.readFully
354Web pages
EOFExceptionDataInputStream.readFully354

FileInputStream.readBytes() has thrown an IOException

java.io.IOException
java.io.FileInputStream.readBytes
291Web pages
IOExceptionFileInputStream.readBytes291

FileOutputStream.openAppend() has thrown a FileNotFoundException

java.io.FileNotFoundException
java.io.FileOutputStream.openAppend
264Web pages
FileNotFoundExceptionFileOutputStream.openAppend264

ObjectInputStream.readObject0() has thrown a StreamCorruptedException

java.io.StreamCorruptedException
java.io.ObjectInputStream.readObject0
254Web pages
StreamCorruptedExceptionObjectInputStream.readObject0254

DataInputStream.readByte() has thrown an EOFException

java.io.EOFException
java.io.DataInputStream.readByte
205Web pages
EOFExceptionDataInputStream.readByte205

RandomAccessFile.writeBytes() has thrown an IOException

java.io.IOException
java.io.RandomAccessFile.writeBytes
190Web pages
IOExceptionRandomAccessFile.writeBytes190

BufferedInputStream.getBufIfOpen() has thrown an IOException

java.io.IOException
java.io.BufferedInputStream.getBufIfOpen
190Web pages
IOExceptionBufferedInputStream.getBufIfOpen190

StringReader.<init>() has thrown a NullPointerException

java.lang.NullPointerException
java.io.StringReader.<init>
188Web pages
NullPointerExceptionStringReader.<init>188

ObjectStreamClass$FieldReflector.setObjFieldValues() has thrown a ClassCastException

java.lang.ClassCastException
java.io.ObjectStreamClass$FieldReflector.setObjFieldValues
179Web pages
ClassCastExceptionObjectStreamClass$FieldReflector.setObjFieldValues179

Writer.write() has thrown a NullPointerException

java.lang.NullPointerException
java.io.Writer.write
169Web pages
NullPointerExceptionWriter.write169

DataInputStream.readUnsignedShort() has thrown an EOFException

java.io.EOFException
java.io.DataInputStream.readUnsignedShort
126Web pages
EOFExceptionDataInputStream.readUnsignedShort126

DataInputStream.readUTF() has thrown an UTFDataFormatException

java.io.UTFDataFormatException
java.io.DataInputStream.readUTF
115Web pages
UTFDataFormatExceptionDataInputStream.readUTF115

RandomAccessFile.open0() has thrown a FileNotFoundException

java.io.FileNotFoundException
java.io.RandomAccessFile.open0
113Web pages
FileNotFoundExceptionRandomAccessFile.open0113

ObjectOutputStream.outputObject() has thrown a NotSerializableException

java.io.NotSerializableException
java.io.ObjectOutputStream.outputObject
111Web pages
NotSerializableExceptionObjectOutputStream.outputObject111

FileInputStream.<init>() has thrown a NullPointerException

java.lang.NullPointerException
java.io.FileInputStream.<init>
108Web pages
NullPointerExceptionFileInputStream.<init>108

ByteArrayOutputStream.expand() has thrown an OutOfMemoryError

java.lang.OutOfMemoryError
java.io.ByteArrayOutputStream.expand
105Web pages
OutOfMemoryErrorByteArrayOutputStream.expand105

File.fixSlashes() has thrown a NullPointerException

java.lang.NullPointerException
java.io.File.fixSlashes
104Web pages
NullPointerExceptionFile.fixSlashes104

RandomAccessFile.seek() has thrown an IOException

java.io.IOException
java.io.RandomAccessFile.seek
103Web pages
IOExceptionRandomAccessFile.seek103

BufferedInputStream.getInIfOpen() has thrown an IOException

java.io.IOException
java.io.BufferedInputStream.getInIfOpen
100Web pages
IOExceptionBufferedInputStream.getInIfOpen100

ByteArrayInputStream.<init>() has thrown a NullPointerException

java.lang.NullPointerException
java.io.ByteArrayInputStream.<init>
97Web pages
NullPointerExceptionByteArrayInputStream.<init>97

ObjectInputStream$BlockDataInputStream.setBlockDataMode() has thrown an IllegalStateException

java.lang.IllegalStateException
java.io.ObjectInputStream$BlockDataInputStream.setBlockDataMode
89Web pages
IllegalStateExceptionObjectInputStream$BlockDataInputStream.setBlockDataMode89

ObjectOutputStream.writeNewObject() has thrown a NotSerializableException

java.io.NotSerializableException
java.io.ObjectOutputStream.writeNewObject
88Web pages
NotSerializableExceptionObjectOutputStream.writeNewObject88

DataInputStream.readUnsignedByte() has thrown an EOFException

java.io.EOFException
java.io.DataInputStream.readUnsignedByte
84Web pages
EOFExceptionDataInputStream.readUnsignedByte84

PipedInputStream.read() has thrown an IOException

java.io.IOException
java.io.PipedInputStream.read
79Web pages
IOExceptionPipedInputStream.read79

OutputStream.write() has thrown an IOException

java.io.IOException
1 frames hidden
java.io.OutputStream.write
71Web pages
IOExceptionOutputStream.write71

BufferedInputStream.read() has thrown an IndexOutOfBoundsException

java.lang.IndexOutOfBoundsException
java.io.BufferedInputStream.read
68Web pages
IndexOutOfBoundsExceptionBufferedInputStream.read68

PipedInputStream.checkStateForReceive() has thrown an IOException

java.io.IOException
java.io.PipedInputStream.checkStateForReceive
65Web pages
IOExceptionPipedInputStream.checkStateForReceive65

ObjectStreamClass.validateLocalClass() has thrown an InvalidClassException

java.io.InvalidClassException
java.io.ObjectStreamClass.validateLocalClass
63Web pages
InvalidClassExceptionObjectStreamClass.validateLocalClass63

FileInputStream.<init>() has thrown a FileNotFoundException

java.io.FileNotFoundException
java.io.FileInputStream.<init>
62Web pages
FileNotFoundExceptionFileInputStream.<init>62

ObjectInputStream.readObject0() has thrown an OptionalDataException

java.io.OptionalDataException
java.io.ObjectInputStream.readObject0
60Web pages
OptionalDataExceptionObjectInputStream.readObject060

BufferedWriter.ensureOpen() has thrown an IOException

java.io.IOException
java.io.BufferedWriter.ensureOpen
55Web pages
IOExceptionBufferedWriter.ensureOpen55

ObjectInputStream.readObject0() has thrown a WriteAbortedException

java.io.WriteAbortedException
java.io.ObjectInputStream.readObject0
54Web pages
WriteAbortedExceptionObjectInputStream.readObject054

RandomAccessFile.readFully() has thrown an EOFException

java.io.EOFException
java.io.RandomAccessFile.readFully
54Web pages
EOFExceptionRandomAccessFile.readFully54

RandomAccessFile.readInt() has thrown an EOFException

java.io.EOFException
java.io.RandomAccessFile.readInt
48Web pages
EOFExceptionRandomAccessFile.readInt48

BufferedInputStream.reset() has thrown an IOException

java.io.IOException
java.io.BufferedInputStream.reset
44Web pages
IOExceptionBufferedInputStream.reset44

DataOutputStream.writeUTF() has thrown an UTFDataFormatException

java.io.UTFDataFormatException
java.io.DataOutputStream.writeUTF
44Web pages
UTFDataFormatExceptionDataOutputStream.writeUTF44
Package namePatterns foundSolution coverageSummary coverage
java.lang40923
java.io3899
java.awt3658
java.util.concurrent3515
java.lang.reflect3504
sun.reflect2130
java.util2081
java.net2075
javax.swing1412
java.security861
javax.naming844
java.sql696
sun.net.www.protocol.https693
sun.net.www.protocol.http691
sun.nio.ch460
java.util.zip291
sun.rmi.server288
java.nio.file270
java.util.regex261
sun.rmi.transport.tcp261
com.sun.jndi.ldap245
com.sun.org.apache.xerces.internal.impl236
com.sun.org.apache.xerces.internal.parsers225
javax.swing.plaf.basic219
sun.net.www.http217
java.util.stream186
sun.misc180
java.util.logging155
com.sun.org.apache.xerces.internal.jaxp150
java.nio148
java.util.jar144
javax.swing.text142
sun.launcher138
java.beans137
java.text133
javax.imageio130
sun.rmi.registry127
javax.net.ssl117
javax.management.remote.rmi116
javax.security.auth.login115
java.rmi114
com.sun.org.apache.xalan.internal.xsltc.trax110
sun.nio.cs110
java.awt.image104
sun.rmi.transport97
javax.security.auth97
java.nio.channels95
sun.instrument92
java.awt.event86
javax.naming.directory78
Package nameClass namePatterns foundSolution coverageSummary coverage
java.ioObjectInputStream1016
java.ioObjectOutputStream538
java.ioBufferedInputStream254
java.ioBufferedOutputStream206
java.ioFile186
java.ioBufferedReader177
java.ioDataInputStream169
java.ioFilterInputStream132
java.ioFileInputStream111
java.ioFileOutputStream98
java.ioRandomAccessFile87
java.ioInputStreamReader76
java.ioInputStream72
java.ioDataOutputStream71
java.ioObjectStreamClass64
java.ioFilterOutputStream58
java.ioBufferedWriter57
java.ioOutputStreamWriter56
java.ioPrintStream52
java.ioOutputStream50
java.ioPrintWriter47
java.ioObjectInputStream$BlockDataInputStream37
java.ioWriter28
java.ioReader27
java.ioFileReader27
java.ioByteArrayOutputStream23
java.ioObjectOutputStream$BlockDataOutputStream22
java.ioFileWriter20
java.ioObjectInputStream$PeekInputStream20
java.ioUnixFileSystem19
java.ioStringWriter15
java.ioPushbackInputStream14
java.ioObjectStreamClass$29
java.ioPipedInputStream7
java.ioFilePermission7
java.ioIOException5
java.ioPipedOutputStream4
java.ioByteArrayInputStream3
java.ioObjectStreamClass$13
java.ioFileDescriptor3
java.ioObjectOutputStream$HandleTable3
java.ioBufferedReader$13
java.ioObjectStreamClass$FieldReflector2
java.ioFilePermission$12
java.ioSequenceInputStream2
java.ioObjectInputStream$HandleTable2
java.ioFilterWriter2
java.ioStringReader2
java.ioCharArrayWriter1
java.ioConsole1
Package nameClass nameMethod namePatterns foundSolution coverage
java.ioObjectInputStreamreadObject0335
java.ioObjectInputStreamreadObject333
java.ioObjectOutputStreamwriteObject0206
java.ioObjectOutputStreamwriteObject179
java.ioBufferedInputStreamread160
java.ioFilterInputStreamread119
java.ioBufferedReaderreadLine108
java.ioBufferedOutputStreamflush98
java.ioFileInputStream<init>74
java.ioObjectInputStreamdefaultReadFields69
java.ioInputStreamread67
java.ioInputStreamReaderread66
java.ioBufferedInputStreamfill61
java.ioObjectInputStreamreadClassDesc61
java.ioFileOutputStream<init>58
java.ioBufferedOutputStreamflushBuffer56
java.ioOutputStreamwrite51
java.ioObjectOutputStreamdefaultWriteFields50
java.ioFilecreateTempFile39
java.ioBufferedOutputStreamwrite38
java.ioDataInputStreamread37
java.ioObjectInputStreamreadOrdinaryObject35
java.ioDataInputStreamreadFully35
java.ioBufferedReaderfill33
java.ioBufferedWriterflush31
java.ioRandomAccessFile<init>28
java.ioDataOutputStreamwrite28
java.ioDataInputStreamreadInt28
java.ioFileReader<init>27
java.ioObjectInputStreamresolveClass26
java.ioWriterwrite26
java.ioFilterOutputStreamclose25
java.ioObjectInputStreamdefaultReadObject25
java.ioBufferedReaderread25
java.ioFileOutputStreamwrite25
java.ioReaderread24
java.ioObjectInputStream<init>24
java.ioOutputStreamWriterflush24
java.ioObjectOutputStreamdefaultWriteObject23
java.ioPrintStreamprintln23
java.ioDataInputStreamreadByte22
java.ioDataOutputStreamflush22
java.ioDataInputStreamreadUTF22
java.ioFilterOutputStreamwrite22
java.ioFileInputStreamread21
java.ioObjectStreamClasslookup21
java.ioFileWriter<init>20
java.ioFileexists18
java.ioObjectOutputStreamwriteOrdinaryObject18
java.ioObjectInputStreamreadSerialData18
Package nameClass nameMethod nameException TypePatterns foundSolution coverage
java.ioObjectOutputStreamwriteObject0NotSerializableException137
java.ioObjectOutputStreamwriteObjectNotSerializableException124
java.ioObjectInputStreamreadObjectClassNotFoundException86
java.ioObjectInputStreamreadObject0ClassNotFoundException83
java.ioObjectInputStreamreadObjectInvalidClassException52
java.ioObjectInputStreamreadObject0InvalidClassException46
java.ioFilterInputStreamreadIOException41
java.ioBufferedInputStreamreadSocketException38
java.ioBufferedReaderreadLineIOException36
java.ioFileOutputStream<init>FileNotFoundException35
java.ioBufferedInputStreamreadSocketTimeoutException34
java.ioFileInputStream<init>FileNotFoundException34
java.ioBufferedOutputStreamflushSSLHandshakeException32
java.ioObjectOutputStreamwriteObject0StackOverflowError30
java.ioObjectOutputStreamdefaultWriteFieldsNotSerializableException29
java.ioFilecreateTempFileIOException29
java.ioBufferedInputStreamreadIOException29
java.ioObjectInputStreamreadObjectStreamCorruptedException28
java.ioObjectInputStreamreadObject0StreamCorruptedException25
java.ioObjectInputStreamreadObject0EOFException23
java.ioInputStreamReaderreadIOException23
java.ioObjectInputStreamreadClassDescClassNotFoundException21
java.ioObjectInputStreamreadObjectEOFException21
java.ioObjectInputStreamresolveClassClassNotFoundException21
java.ioObjectInputStreamreadObjectClassCastException21
java.ioObjectInputStreamreadObject0ClassCastException19
java.ioFilterInputStreamreadSocketException19
java.ioFilterInputStreamreadSocketTimeoutException19
java.ioFilterInputStreamreadZipException19
java.ioObjectInputStreamreadObject0OutOfMemoryError18
java.ioObjectOutputStreamdefaultWriteObjectNotSerializableException18
java.ioObjectInputStreamreadObject0IllegalStateException17
java.ioOutputStreamwriteIOException17
java.ioBufferedOutputStreamflushSocketException16
java.ioInputStreamreadIOException16
java.ioObjectInputStreamreadObject0SparkException15
java.ioBufferedInputStreamfillSocketTimeoutException15
java.ioFileWriter<init>FileNotFoundException15
java.ioBufferedOutputStreamflushIOException15
java.ioFileReader<init>FileNotFoundException14
java.ioBufferedReaderreadLineSocketException14
java.ioFileOutputStreamwriteIOException14
java.ioBufferedOutputStreamwriteSocketException14
java.ioObjectInputStreamreadObjectIllegalStateException14
java.ioRandomAccessFile<init>FileNotFoundException14
java.ioBufferedInputStreamreadSSLException14
java.ioObjectInputStreamreadObjectUnmarshalException14
java.ioPrintStreamprintlnStackOverflowError13
java.ioObjectOutputStreamwriteObject0ConcurrentModificationException13
java.ioBufferedOutputStreamflushBufferIOException13