Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Posts: 86
Registered: ‎07-21-2009
My Device: Not Specified

How to debug file accesses while testing in the simulator?

Hi everybody

My app will be reading some info from an xml file.

My understanding is that it will be in a dir

  "file:///store/home/user/ "

when deployed.  



I need to test parsing an retrieving info from this xml file on the simulator.

Where should the file go?


        try {
           fconn = (FileConnection)Connector.open("file:///store/home/" +  fname);
            InputStream istream = fconn.openInputStream();      // EXCEPTION
            InputSource is = new InputSource(istream); 
            document = builder.parse(is);
        } catch (IOException e) {
            return null;
        } catch (SAXException e) {
            return null;


I get to the IOException with code 8 which is FILENAME_NOT_FOUND.

I am using Eclipse with net API 4.7.



I have tried putting my xml file in various places within the Eclipse project.

I have also tried putting it in the simulator directory.


I really need to debug this.

thanks so much!!!


New Developer
Posts: 26
Registered: ‎10-23-2009
My Device: Not Specified

Re: How to debug file accesses while testing in the simulator?

How is the file going to be placed in file:///store/home/fname on the real device? You should be able to use the same procedure on the simulator. As an alternative, you can change the location to file:///store/home/user/pictures, simulate a USB connection from the simulator menu, start up Media Manager, copy the file to the simulator using Media Manager.