Questions tagged [eofexception]

An exception that occurs when reading from a stream or file, and indicates that the end of the stream has been reached. For example, you had expected to read 4 bytes from a stream with DataInputStream.readFully(), or an object with ObjectInputStream.readObject(), but end of stream was encountered instead.

An exception that occurs when reading from a stream or file, and indicates that the end of the stream has been reached. For example, you had expected to read 4 bytes from a stream with DataInputStream.readFully(), or an object with ObjectInputStream.readObject(), but end of stream was encountered instead.

Even though the exception is named EOF for 'end of file', it is possible to get this exception when processing any data stream. The exception can occur as a result of many different actions, such as:

  1. Reading data from a socket connection that has already been closed by the peer and all prior pending data has already been read.
  2. Reading data from an empty file.

When reading from a stream, you should usually detect and handle this exception, as well as other stream-related exceptions such as timeouts, by wrapping your reads in a try-catch block. This will allow you to catch exceptions such as this, and perform an alternate operation, such as alerting the user of the error, or ending the logical connection at this end.

214 questions
0
votes
1 answer

EOFException thrown on BlackBerry when trying to open TLS connection with Connector.open()

Sometimes I get EOFException when I try to open a TLS connection over Wi-Fi with Connector.open("tls://sub.domain.com:443;deviceside=true;interface=wifi;EndToEndRequired"); The call to Connector.open() is blocking. The EOFException is thrown about…
tonymontana
  • 5,728
  • 4
  • 34
  • 53
0
votes
0 answers

REACT-NATIVE Task :expo-modules-core:externalNativeBuildCleanRelease FAILED

I am a newbie to React Native. I was trying to build an APK in my project. I was successfully able to make APKs before in the current project. But recently I started getting the following error. I have no idea why or what is causing this. I even…
ARC
  • 1
  • 1
0
votes
1 answer

End of input at line 1 column 1 path $ - Not solved by other solutions

New to Api's. I had a working API. My Get and post worked. Now only my get works and my post makes my app crash after every post. Initially when it did work I got a error code of 500. Server side. Since then we have worked on the server and fixed a…
helpVulcan
  • 105
  • 9
0
votes
1 answer

ObjectInputStream returning EOFException when reading List of Object

Im returning a list of all the objects stored in some temporary files in my Android project. When the list its appended the file its deleted. public static List fileToLogList(Context context) { String path = context.getFilesDir() …
0
votes
1 answer

Not sure why I'm getting an EOFException

I'm trying to read objects from a file that I have written to but when reading there's an EOFException that gets thrown. I can see that it reads the objects but halfway through reading the file the error shows up. public class IOStream { /** …
Avi
  • 25
  • 4
0
votes
0 answers

Got java.lang.RuntimeException: java.io.EOFException, http call failed after milliseconds for url, for multiple scenarios

I have, for example, this simple scenario: Scenario: Validate user ID Given path usersUrl + randomEmail + '/validate' When method GET Then status 200 And match response == read('schemas/details.json') During the execution it fails on step…
Yury 1
  • 1
0
votes
1 answer

Why doesn't the ObjectOutputStream write the variables in the file as intended?

I am learning Java and I'm trying to get a programme to write the attributes of one class instance of another into a .txt file, like a phonebook for instance. I have a class User : package idpack; import java.io.Serializable; public class User…
0
votes
1 answer

Java read .cdr-File

right now I#m trying to write a program which reads a .cdr-File. The Format of the CDR-File looks like this: *************** * File header * *************** File…
0
votes
0 answers

occasional EOFException from camel (jetty)

We have an application that using Apache camel to call REST API. And we got EOFExceptions from jetty occasionally. Some more observations: we're not using https it happens very sporadically (once for per 10K ?) Does anybody known the reason and…
lampmagic
  • 1
  • 1
0
votes
1 answer

Race Condition in JaCoCo merge when generating a report?

So this is something, that a colleague called a "Schroedingers Bug" - it worked fine, until something was pointed out. Something was changed and now the bug is there. And changing back didn't help - the bug is still there :-/ In our Maven project we…
CHH
  • 140
  • 1
  • 8
0
votes
1 answer

How can I add the objects from a file into ArrayList? getting a EOFException

I am working on a school project that basically allows the user to create, edit and display students. I have a createStudent() that writes the info into the file using Scanner and ObjectOutputStream. The displayStudent() reads the data from the file…
0
votes
1 answer

Socket communication between ESP32 and java local server

I'm trying to set a simple communication between an ESP32 as client, and a Java server running on my Windows PC. I have this python code for the server that works: import socket s = socket.socket() s.bind(('192.168.1.246', 8090…
0
votes
1 answer

Java : Unexpected end of ZLIB input stream while attempting to merge split zip files

I have split zip files that I'm trying to merge using Java. But I get Unexpected end of ZLIB input stream error. Any thoughts on what I'm doing wrong? File bigZip = new File("bigZip.zip"); List zipList =…
0
votes
1 answer

EOFException with ObjectInputStream

I have read other questions similar to this but didn't help much. So I have some serialized content in a file and I am trying to read it and print it on the console, content is getting printed fine but at the end, it's showing an EOFException. Is…
user13933479
0
votes
1 answer

EOFException while executing query in sql

The code was working fine from the last 1 year properly but from last 1 week I am getting EOFException while Exceuting the select query:The query is as below SELECT col1,col2,col3,col4 from Table where col1 in ('val1','val2','val3','val4') The…