Web application cannot find files when deployed

1.1k views Asked by At

I have an application that uses files.txt to work. When I test the application with a main Class it works but when I deploy it I have this error :

    java.io.FileNotFoundException: keyWords/CA.txt (No such file or directory)
    java.io.FileNotFoundException: keyWords/CA.txt (No such file or directory)
    java.io.FileNotFoundException: keyWords/NormalWords.txt (No such file or directory)

How can I make this work. Thanks !

1

There are 1 answers

0
deltascience On BEST ANSWER

I resolved the problem by giving complete path: in the ide right click on the file and go to Properties; to get absolute path. Give that path as input file. It works for me. HTH !