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
38
votes
5 answers

java IO Exception: Stream Closed

This is the code I currently have: public class FileStatus extends Status{ FileWriter writer; public FileStatus(){ try { writer = new FileWriter("status.txt",true); } catch (IOException e) { e.printStackTrace(); …
ez4nick
  • 9,756
  • 12
  • 37
  • 69
37
votes
8 answers

SQLRecoverableException: I/O Exception: Connection reset

Yesterday evening I left the office with a running Java program written by me. It should insert a lot of records into our company database (Oracle) using a JDBC connection. This morning when I came back to work I saw this error (caught by a…
Maik
  • 811
  • 3
  • 22
  • 35
37
votes
6 answers

Run a command shell in jenkins

I'm trying to execute a command shell in Jenkins, I'm working on Windows 7. In the console output I have this: Building in workspace C:\Program Files (x86)\Jenkins\workspace\test [test] $ sh -xe C:\Windows\TEMP\hudson6299483223982766034.sh The…
Med braim
  • 463
  • 1
  • 7
  • 12
32
votes
2 answers

MediaPlayer.setDataSource causes IOException for valid file

This code used to work. Then, maybe I changed something, somewhere (or if I know Android right, an update introduced a bug in the media player). It stopped working on some devices! Especially my Nexus S (2.3.6). The file test.m4a (17 775 201 bytes)…
l33t
  • 18,692
  • 16
  • 103
  • 180
31
votes
8 answers

Cannot make file java.io.IOException: No such file or directory

I am trying to create a file on the filesystem, but I keep getting this exception: java.io.IOException: No such file or directory I have an existing directory, and I am trying to write a file to that directory. // I have also tried this below, but…
Shervin Asgari
  • 23,901
  • 30
  • 103
  • 143
31
votes
12 answers

Force IOException during file reading

I have a piece of code that reads data from a file. I want to force IOException in this code for testing purposes (I want to check if the code throws a correct custom exception in this case). Is there any way to create a file which is protected from…
DixonD
  • 6,557
  • 5
  • 31
  • 52
31
votes
13 answers

javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed; boundary

Currently I'm inline of writing a code that will be listening to a directory. when the directory is updated with .apk file, I'll send a mail with this .apk file to a gmail account. I'm using Jnotify and JAVA Mail in my program. The Error I'm getting…
Vidhee
  • 777
  • 1
  • 6
  • 14
30
votes
4 answers

PostgreSQL and Hibernate java.io.IOException: Tried to send an out-of-range integer as a 2-byte value

I have hibernate query: getSession() .createQuery("from Entity where id in :ids") .setParameterList("ids", ids) .list(); where ids is Collection ids, that can contain a lot of ids. Currently I got…
30
votes
4 answers

Why is InputStream.close() declared to throw IOException?

The java.io.InputStream.close() method is declared to throw an IOException. Under what circumstances would such an exception actually be thrown? Edit: Yes I have read the javadoc. Can anybody be more specific than "when an I/O error occurs"? What…
meriton
  • 68,356
  • 14
  • 108
  • 175
29
votes
5 answers

Does close ever throw an IOException?

After providing some answers here, and reading some comments, it would seem that, in practice IOException is never thrown on close for file I/O. Are there any cases in which calling close on a Stream/Reader/Writer actually throws an IOException? If…
TofuBeer
  • 60,850
  • 18
  • 118
  • 163
29
votes
6 answers

IOException: Too many open files

I'm trying to debug a file descriptor leak in a Java webapp running in Jetty 7.0.1 on Linux. The app had been happily running for a month or so when requests started to fail due to too many open files, and Jetty had to be…
Mirko N.
  • 10,537
  • 6
  • 38
  • 37
28
votes
3 answers

java.io.IOException: Server returned HTTP response code: 403 for URL

My code goes like this: URL url; URLConnection uc; StringBuilder parsedContentFromUrl = new StringBuilder(); String urlString="http://www.example.com/content/w2e4dhy3kxya1v0d/"; System.out.println("Getting content for URl : " + urlString); url = new…
vaibhav
  • 3,929
  • 8
  • 45
  • 81
27
votes
10 answers

System.IO.IOException: file used by another process

I've been working on this small piece of code that seems trivial but still, i cannot really see where is the problem. My functions do a pretty simple thing. Opens a file, copy its contents, replace a string inside and copy it back to the original…
srodriguez
  • 1,937
  • 2
  • 24
  • 42
26
votes
2 answers

Java: Exception itself is null

I am pretty confused. Is it an Android problem or a problem with Java itself? When I was debugging an Android application which works with Bluetooth, the flow stopped on an catch block of IOException in which I later found out that exception e was…
Prasham
  • 6,646
  • 8
  • 38
  • 55
26
votes
8 answers

java.io.IOException: SERVICE_NOT_AVAILABLE in GCM Client

I want to implement an gcm client into an existing android app. So, by following this tutorial I wrote following code: public class RegisterForGCMAsyncTask extends AbstractSecureOperationTask { ... @Override protected Boolean…
1
2
3
96 97