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

You need to check the HResult and test against ERROR_DISK_FULL (0x70) and ERROR_HANDLE_DISK_FULL (0x27), which can be converted to HResults by OR‘ing with 0x80070000. For .Net Framework 4.5 and above, you can use the Exception.HResult property: static bool IsDiskFull(Exception ex) { const int HR_ERROR_HANDLE_DISK_FULL = unchecked((int)0x80070027); const int HR_ERROR_DISK_FULL = unchecked((int)0x80070070); return ex.HResult == HR_ERROR_HANDLE_DISK_FULL … Read more

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

Just ran into this problem running mahout from CDH4 in standalone mode in my MacBook Air. The issue is that a /tmp/hadoop-xxx/xxx/LICENSE file and a /tmp/hadoop-xxx/xxx/license directory are being created on a case-insensitive file system when unjarring the mahout jobs. I was able to workaround this by deleting META-INF/LICENSE from the jar file like this: … Read more

java.io.IOException : No authentication challenges found

This error happens because the server sends a 401 (Unauthorized) but does not give a WWW-Authenticate header which is a hint to the client what to do next. The WWW-Authenticate header tells the client, which kind of authentication is needed (either Basic or Digest). This is probably not very useful in headless http clients, but … Read more

java.io.IOException: mark/reset not supported

The documentation for AudioSystem.getAudioInputStream(InputStream) says: The implementation of this method may require multiple parsers to examine the stream to determine whether they support it. These parsers must be able to mark the stream, read enough data to determine whether they support the stream, and, if not, reset the stream’s read pointer to its original position. … Read more

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

I received this error when calling a web-service. The issue was also related to transport level security. I could call the web-service through a website project, but when reusing the same code in a test project I would get a WebException that contained this message. Adding the following line before making the call resolved the … Read more

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

What is the cause? The error message is pretty clear: you’re trying to access a file, and it’s not accessible because another process (or even the same process) is doing something with it (and it didn’t allow any sharing). Debugging It may be pretty easy to solve (or pretty hard to understand), depending on your … Read more