Okay, that's embarrassing, because everything was fine in the debug mode. But when I tried to test my (almost finished) app once I deployed it, I got a 500 server error: "The server encountered an error and could not complete your request."
Maybe it's because I am trying to read a local file. I have searched on Internet for a possible solution but none of them works. Here's the code I had on the debug mode:
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
String path = "C:\\Users\\Alice\\Desktop\\data.txt";
BufferedReader br = null;
try
{
br = new BufferedReader(new FileReader(path));
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
String line;
try
{
line = br.readLine(); // In the deploy mode I got here a NullPointerException
}
catch (IOException e)
{
e.printStackTrace();
}
}
AccessControlled allows me to read a local file from a Servlet.
Is there a possible way to read a file like in the debug mode when the app is deployed on Google App Engine?
Thank you all for the help!
Alice
EDIT: I have found the error and has nothing to do with if I am correctly reading the file or not. Looking at the logs, I saw that: The API call datastore_v3.RunQuery() required more quota than is available.
Which means I have exceeded the limit of writing data on the datastore.