Questions tagged [ioexception]

IOException is the general class of exceptions produced by failed or interrupted input/output operations in several languages, including Java and C#.

IOException is the general class of exceptions produced by failed or interrupted Input/Output operations in several languages, including Java and C# and other .NET languages.

1451 questions
262
votes
12 answers

IOException: The process cannot access the file 'file path' because it is being used by another process

I have some code and when it executes, it throws a IOException, saying that The process cannot access the file 'filename' because it is being used by another process What does this mean, and what can I do about it?
Adriano Repetti
  • 65,416
  • 20
  • 137
  • 208
164
votes
28 answers

Unable to read data from the transport connection : An existing connection was forcibly closed by the remote host

I have a server app and sometimes, when the client tries to connect, I get the following error: NOTE: the "couldn't get stream from client or login failed" is a text that's added by me in catch statement and the line at which it stops ( sThread :…
Alex
  • 10,869
  • 28
  • 93
  • 165
89
votes
5 answers

java.io.IOException: mark/reset not supported

try { //String location = dir1.getCanonicalPath()+"\\app_yamb_test1\\mySound.au"; //displayMessage(location); AudioInputStream audio2 = AudioSystem.getAudioInputStream(getClass().getResourceAsStream("mySound.au")); Clip clip2 =…
Crais
  • 903
  • 1
  • 6
  • 4
85
votes
8 answers

When is "java.io.IOException:Connection reset by peer" thrown?

ERROR GServerHandler - java.io.IOException: Connection reset by peer java.io.IOException: Connection reset by peer at sun.nio.ch.FileDispatcher.read0(Native Method) at sun.nio.ch.SocketDispatcher.read(Unknown Source) at…
WorM
  • 1,115
  • 1
  • 12
  • 18
71
votes
5 answers

How to check if IOException is Not-Enough-Disk-Space-Exception type?

How can I check if IOException is a "Not enough disk space" exception type? At the moment I check to see if the message matches something like "Not enough disk space", but I know that this won't work if the OS language is not English.
jotbek
  • 1,479
  • 3
  • 14
  • 22
70
votes
3 answers

HttpClient request throws IOException

The following code throws a IOException with the message: "The specified registry key does not exist." HttpClient client = new HttpClient(); Uri uri = new Uri("http://www.google.com"); client.GetAsync(uri); This is just in a console app in Main.…
JFoulkes
  • 2,429
  • 1
  • 21
  • 24
65
votes
5 answers

Using e.printStackTrace() in Java

This is probably a newbie question, but hope you can help me. :) I have something like this: try { //try to do something there } catch (IOException e) { //handle the exception e.printStackTrace(); } I am using NetBeans IDE and for some reason the…
O_O
  • 4,397
  • 18
  • 54
  • 69
60
votes
18 answers

WPF IOException Cannot locate resource

I have a WPF application. The page that opens when the app runs in MainWindow.xaml, as set in the StartupUri attribute of the App.xaml file. This page opens fine. However, if I try to open any other windows using the Show or ShowDialog method I…
lace.john
  • 1,051
  • 2
  • 17
  • 22
56
votes
3 answers

What throws an IOException in Java?

java.io.IOException seems to be the most common type of exception, and coincidentally, it seems to also be the most ambiguous. I keep seeing the throws IOException whenever writing with sockets, files, etc. I've never actually had one fired on me,…
Zaq
  • 1,348
  • 1
  • 11
  • 19
53
votes
33 answers

java.io.IOException: FIS_AUTH_ERROR in Android Firebase

I'm getting following error with Firebase services. E/FirebaseInstanceId: Topic sync or token retrieval failed on hard failure exceptions: FIS_AUTH_ERROR. Won't retry the operation. D/AndroidRuntime: Shutting down VM …
Aykut Uludağ
  • 1,876
  • 5
  • 18
  • 34
46
votes
6 answers

Why do I get the "Unhandled exception type IOException"?

I have the following simple code: import java.io.*; class IO { public static void main(String[] args) { BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in)); String userInput; while…
Roman
  • 124,451
  • 167
  • 349
  • 456
45
votes
11 answers

Wait for file to be freed by process

How do I wait for the file to be free so that ss.Save() can overwrite it with a new one? If I run this twice close together(ish), I get a generic GDI+ error. /// /// Grabs a screen shot of the App and saves it to the C drive in…
Refracted Paladin
  • 12,096
  • 33
  • 123
  • 233
45
votes
8 answers

Hadoop java.io.IOException: Mkdirs failed to create /some/path

When I try to run my Job I am getting the following exception: Exception in thread "main" java.io.IOException: Mkdirs failed to create /some/path at org.apache.hadoop.util.RunJar.ensureDirectory(RunJar.java:106) at…
alien01
  • 1,334
  • 2
  • 14
  • 31
39
votes
5 answers

System.IO.Exception error: "The requested operation cannot be performed on a file with a user-mapped section open."

I received a very weird IOException when writing to an XML file: System.IO.IOException: The requested operation cannot be performed on a file with a user-mapped section open. at System.IO.__Error.WinIOError(Int32 errorCode, String…
Bryan Denny
  • 27,363
  • 32
  • 109
  • 125
38
votes
5 answers

Error message "unreported exception java.io.IOException; must be caught or declared to be thrown"

Error: filecontent.java:15: unreported exception java.io.IOException; must be caught or declared to be thrown showfile(); ^ filecontent.java:78: unreported exception java.io.IOException; must be caught or …
Akash Patel
  • 381
  • 1
  • 4
  • 5
1
2 3
96 97