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
6
votes
1 answer

How to catch Glide Exceptions Properly?

Am using Glide 4.x and getting FileNotFoundException as the URL returns 404. I tried to catch the exception using the RequestListener. But it is not Caching this Exception. …
Nizamudeen Sherif
  • 1,002
  • 1
  • 12
  • 38
6
votes
0 answers

Android FileNotFoundException getting thrown from URL.openStream()

I have an application that is connecting to a webservice. I have one user with an LG Optimus T that is getting a FileNotFoundException whenever the app tries to connect to the web service on his device. I know that the device is connected to the…
FoamyGuy
  • 46,603
  • 18
  • 125
  • 156
6
votes
0 answers

Android XML resources missing on some devices

I'm seeing an intermittent crash from a few devices in the wild where Android reports FileNotFoundException inflating a resource file. Initially, it was just Android SDK provided resources: res/interpolator/linear_out_slow_in.xml …
Mike Jancola
  • 431
  • 4
  • 10
6
votes
1 answer

FileNotFoundException for NuGet package

I downloaded and installed the NuGet Package: Select.Pdf. At runtime, when I click on the button that utilizes the code using the Select.Pdf namespace, I get the following exception: The package is in the proper file directory and is properly…
Uchiha Itachi
  • 1,251
  • 1
  • 16
  • 42
6
votes
3 answers

java.io.FileNotFoundException when using RandomAccessFile to create file

I'm encountering a FileNotFoundException when I try to make a file using RandomAccessFile: RandomAccessFile file = new RandomAccessFile("/test.jpg", "rw"); I don't now how to get around this. It's driving me nuts. Thanks
mlevit
  • 2,676
  • 10
  • 42
  • 50
6
votes
3 answers

Spring-Boot Resource Not Found when using executeable Jar

again I face a strange issue and hope someone here can help. I have a spring boot backend module, what works in eclipse well and application is executeable when starting main in application.java. Everything fine. My application makes import of…
6
votes
1 answer

Reading file from assets throwing FileNotFoundException

I'm using the following code: public void readLevel(int line){ AssetManager am = this.getAssets(); InputStream is = null; try { is = am.open("levelinfo.txt"); } catch (IOException e) { // TODO Auto-generated catch…
Andrew Seymour
  • 250
  • 1
  • 4
  • 18
6
votes
3 answers

java.io.FileNotFoundException in android

I'm selecting a image from gallery using code public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gallery); Intent i = new Intent(Intent.ACTION_PICK,…
6
votes
3 answers

Android - Resources$NotFoundException

I have an App with over 100.000 Users. But on some devices (~50) I get a strange exception. The stack traces says, that there is an drawable not found. Here is the stack trace: java.lang.RuntimeException: Unable to start activity…
Namenlos
  • 1,615
  • 2
  • 18
  • 24
6
votes
3 answers

Save file in Android with spaces in file name

I need for my android application to save an xml file into the external cache with a file name which contains space. DOMSource source = new DOMSource(doc); StreamResult result = new StreamResult(new File(activity …
grattmandu03
  • 1,266
  • 2
  • 13
  • 32
5
votes
3 answers

Any Java debugging tips for finding the cause of "Too Many Files Open"

I'm developing in a linux environment and the system is intended to run continuously over a long period of time. After an overnight test we see the FileNotFoundException with a message of "Too Many Files Open". We started logging the output of the…
Nikordaris
  • 2,297
  • 5
  • 20
  • 30
5
votes
5 answers

update failed java.io.FileNotFoundException

i updated my ide to letest version after update i opend project on which i was working before update but it gave error but when i opend other projects there had no error please help Thank you update failed for…
Ysp
  • 173
  • 1
  • 1
  • 11
5
votes
2 answers

Android 11 get image orientation from EXIF

Hi I have an app with compileSdkVersion 30 and targetSdkVersion 30. Since I need to know the orientation of image, I wrote these: val exif = ExifInterface(imageFile.absolutePath) val orientation = exif.getAttributeInt( …
5
votes
1 answer

FileNotFoundError: [Errno 2] No such file or directory: 'tinycss2\\VERSION'

The full error is: FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\grossj\\AppData\\Local\\Temp\\_MEI143642\\tinycss2\\VERSION' [21148] Failed to execute script main The full error log is: Traceback (most recent call last): …
JareBear
  • 467
  • 9
  • 27
5
votes
3 answers

FileNotFoundException: Could not load file or assembly System.IO.Ports

Yesterday I've worked on a project and got this exception: System.IO.FileNotFoundException: Could not load file or assembly. The system cannot find the file specified. Then I've Googled for hours what the problem could be but didn't find a…
H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144