Questions tagged [filenotfoundexception]

A Java or Android exception that indicates that the file denoted by a specified pathname could not be opened.

This exception is part of the old Java file API. Newer code in Java (note: NOT Android) should use JSR 203 instead (i.e. Paths, Files). JSR 203 (known as NIO.2) has its own java.nio.file.NoSuchFileException, see also .

One problem with this exception is that despite its name, it doesn't always mean that the filesystem object at the given path is actually missing. Here are a few possibilities where this exception can be thrown with a cause other than the file missing:

  • permission denied: an attempt is made to open the file in write mode but the process only has read only access; or the file is in a directory the contents of which the application cannot access;
  • read only filesystem: an attempt is made to open the file in write mode, the process has write access to the file but the underlying filesystem is read only;
  • symbolic link loop: the denoted path is a symbolic link which loops on itself.
1712 questions
0
votes
1 answer

Displaying a contacts picture in imageview.

I use the following to query the image of a contact: Uri phUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI,String.valueOf(contactId)); As a result I get something like: content://com.android.contacts/contacts/3699 Then I try to…
0
votes
0 answers

Android - Both resources and assets go missing

I'm making a game that uses both Android resource and asset folders. It works fine on my device and 90% of the other devices, but few users have had an issue where some or all of the resources and assets suddenly disappear. I have scan.png in my…
0
votes
1 answer

Error "File not found" thrown, even after file is created

My code is quite lengthy, but basically, each time a user clicks a button, it runs two methods - read an array of objects from a file. It then appends a new person's details to this array, then the second method writes to the file. First time, in…
Swedish Architect
  • 389
  • 3
  • 5
  • 23
0
votes
2 answers

Silverlight application broken with FileNotFoundException in System.Windows.Controls

I've been working on converting a Silverlight project from Silverlight 2 to Silverlight 3. Note that I've never had SL 2 binaries or development components installed on my machine (it's only a month old). This has been going fine and the app was…
Alex Angas
  • 59,219
  • 41
  • 137
  • 210
0
votes
1 answer

Android file upload sometimes fails with FileNotFoundException

I have Android application that periodically uploads some files to web server. The problem is that sometimes file is uploaded successfully (and I am getting some response from server), but sometimes I am getting FileNotFoundException at line…
yuralife
  • 1,545
  • 2
  • 21
  • 35
0
votes
2 answers

tomcat7 webapp cannot create directories

I've installed archlinux in the office for development. We use maven to deploy our application to tomcat. I have installed tomcat7.0.47. I've setup everything OK (I think) and I can deploy the webapp to tomcat using tomcat:redeploy. I can start,…
hamid
  • 1,828
  • 1
  • 13
  • 17
0
votes
2 answers

File not found exception

I have a checkbox, that when checked saves a created bitmap to internal storage by doing this: public void SaveImage(Bitmap default_b) { String root = Environment.getExternalStorageDirectory().toString(); File myDir = new File(root +…
0
votes
1 answer

FileNotFound exception with RandomAccessFile using Path obtained from WatchService?

Why would obtaining a RandomAccessFile(path.toFile(),"rw") produce a FileNotFoundException from a Path that was returned from WatchService and the WatchEvent kind is ENTRY_CREATE? java.io.FileNotFoundException:…
The Coordinator
  • 13,007
  • 11
  • 44
  • 73
0
votes
0 answers

how comes the error: FileNotFoundException /proc/mtprof/status occurs?

Sudden out of nowhere the error below comes up whenever I start my activity. this is the complete logcat: http://pastebin.com/Qdz2BCp4 This is my MainActivity in which the error occurs: public class MainActivity extends FragmentActivity { private…
Baklap4
  • 3,914
  • 2
  • 29
  • 56
0
votes
1 answer

writing a simple int[] to android memory

All I would like to do is save and update a simple int[] with 20 highscores from an app I am making, but I keep getting fileNotFoundExceptions. I read: https://developer.android.com/guide/topics/data/data-storage.html#filesExternal, but it was not…
Kdawg
  • 167
  • 11
0
votes
1 answer

netbeans null pointer exception with correct path

this is my first time posting on stackoverflow. I have a question about a series of errors that I have been encountering when I try to read in data from a generic text file in Netbeans IDE 7.4. I am using a 2009 iMac with Mac OS X Mavericks. import…
0
votes
1 answer

FileReader FileNotFoundException when passing a self-built File

This one's a fun one. I'd appreciate any bit of help, and no previous stackoverflow questions are pointing me in the right location. Docs also weren't very helpful to me. I'm being thrown a FileNotFoundException with this block of code: public…
user3022479
  • 25
  • 1
  • 8
0
votes
2 answers

Please help, FileNotFound Exception among other prblems

I'm utterly lost in Arrays and need help...Here is the end objective of this program.... In a file called AccountArray.java, write a client program (your main method) that reads from the file called customers.txt. Read the first number in the file…
user2954611
  • 57
  • 1
  • 1
  • 3
0
votes
3 answers

spring - GenericXmlApplicationContext loading from classpath

I'm newly at spring. I can't understand why when I write some easy example and try it load with ApplicationContents as follows: package com.appres.prospring3.ch5.factory; public class MessageDigestExample { public static void main(String[]…
catch23
  • 17,519
  • 42
  • 144
  • 217
0
votes
2 answers

spring utility project - java.io.FileNotFoundException on Ubuntu

I'm newly at Spring. I tried to write easy project and stack with weird exception FileNotFoundException. To my mind it is some problem with loading app-context.xml. But I sure that set correct absolute path. Any suggestions? Main code: package…
catch23
  • 17,519
  • 42
  • 144
  • 217