You need to provide little bit more information. I believe you are saying that you can build fine, but you get error while running the app? What error message you exactly see. You could run your app in debug mode and add break point at certain line based on the error that you see.

Here is a method. After you start the simulator, first save a file temp.txt making sure that there is a file by that name and appropriate location.
---------------------------------------------------------
public String readFile() {
FileConnection fc = null;
String fileContent = "";
try {
fc = (FileConnection)Connector.open("file:///store/home/user/temp.txt");
if ( (fc==null) || !fc.exists()){
return "File does not exist";
}