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
6 answers

How to handle a FileNotFoundException?

I'm tinkering around on a small application to read some numbers in from a file. Everything runs well so far, but now I have encountered a problem I don't know how I can effectively fix it. If the user enters, unintentionally maybe, the wrong…
tzwickl
  • 1,341
  • 2
  • 15
  • 31
0
votes
1 answer

DocumentBuilder FileNotFoundException when parsing xml String using continuous deployment on tomcat

I have a utility class that converts an Object into an xml String and then builds a pdf out of it. The class was working fine but I recently started to use continuous deployment on Tomcat (i.e. app.war is now deployed as app##00010.war and a new…
0
votes
3 answers

url connection gives FileNotFoundException

I'm doing an application that reads a xml from a url and displays it on screen, but when I want to read the answer gives me a FileNotFoundException this is the code: protected void onCreate(Bundle savedInstanceState) { …
0
votes
4 answers

Android XML file parsing file not found exception

I'm new at Android and trying to get a local XML file and get data and display it . Here's my code: public String GetXmlData() { DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = null; …
albatross
  • 455
  • 2
  • 8
  • 27
0
votes
1 answer

Define Spring bean which depends on file

How could I define a Spring bean which depends on a configuration file that resides in /WEB-INF folder? One of my beans has a constructor which takes a filename of configuration file as an argument. The problem is when I'm trying to instantiate a…
user1140313
0
votes
1 answer

FileNotFoundException (sunrsasing.jar)

I'm translating an api from php to java, i've wrote the following code to emulate sha1 method from php. The problem is that when it creates the new formatter object, I get a FileNotFoundException, debugging I found out that it couldn't find…
pablo
  • 29
  • 5
0
votes
2 answers

File not found exception with external files

Hi i have made a small program that reads a config file. This file is stored outside the actual jar file. On the same level as the jarfile actually. When i start my program from a commandline in the actual directory (ie. D:\test\java -jar name.jar…
Mijno
  • 79
  • 1
  • 2
  • 12
0
votes
2 answers

Jsoup Java FileNotFoundException from URL

I am using Jsoup to scrape a gallery of pictures from this italian website http://www.italiaebraica.org/index.php?option=com_phocagallery&view=category&id=3:famiglia-levi&Itemid=143&lang=it in an AsyncTask with Jsoup i'm getting from the HTML all…
0
votes
5 answers

How can I copy folders to a directory?

How can I copy folders to a directory? I tried almost everything but I cant manage it to work. I got examples from other questions but nothing is working. When I tried to let my application copy a folder it gives me an error: File does not exist:…
user2492979
0
votes
1 answer

How to test a Windows Phone class library that uses System.ServiceModel

I have a Windows Phone 8 class library. Within that class library I make use of System.ServiceModel. The class library runs fine when used from a Windows Phone 8 app. I have a unit test project. If I try and use the unit test project to test methods…
0
votes
2 answers

FileNot Found Exception

This is my class svm_predict package pack.test; import java.io.*; import java.util.*; public class svm_predict { File inputFile; File outputFile; File modelFile; public svm_predict(File inputFile, File modelFile,File outputFile) { super(); …
nawara
  • 1,157
  • 3
  • 24
  • 49
0
votes
0 answers

java network launch protocol error

I'm new in JNLP , when I run .jnlp it's run correctly , but when run it as embedded in html file the follow error is appeared . Please note that every thing is correctly , and run . file not found exception Java Plug-in 10.17.2.02 Using JRE…
Aladdin
  • 221
  • 1
  • 3
  • 11
0
votes
1 answer

How to Control BitmapFactory FileNotFoundException with ListAdapter

I'm making an Activity where I show the contact list of the phone by their names and their photos. I use a Cursor and a Managedquery with a ListAdapter to adapt everything to a layout. It works nice, but I see in Logcat an error related with those…
arkanos
  • 95
  • 1
  • 12
0
votes
1 answer

File Not found exception While using Httpsurlconnection with the REST "POST" function

i am facing problem when i am executing the following code. i am also having same kind of function which perform rest Method DELETE and PUT those are working great with the same config, but this is not. public void Rest_POST(String cookie) { String…
Sohil
  • 51
  • 7
0
votes
4 answers

Java - FilenotfoundException for reading text file

by running this... File file = new File("Highscores.scr"); i keep getting this error, and i really don't know how to get around it. the file is currently sitting in my source packages with my .java files. I can quite easily read the file by…
Joe
  • 45
  • 1
  • 5
1 2 3
99
100