在NetBeans 6.0中创建javax.microedition.rms.RecordStore时出错

在NetBeans 6.0中创建javax.microedition.rms.RecordStore时出错,java,netbeans,java-me,ioexception,recordstore,Java,Netbeans,Java Me,Ioexception,Recordstore,我试图用J2ME编写一个应用程序,它使用javax.microedition.rms.RecordStore存储持久数据。我正在Gentoo上用NetBeans 6.0和J2ME 2.2开发这个项目。当我试图运行项目时,我得到一个错误,因为显然无法创建记录存储。下面是一个输出示例,包括堆栈跟踪: jar: pre-run: cldc-run: Copying 1 file to /home/dzaslavs/ellipsix/programming/cataschedule/dist/nbrun

我试图用J2ME编写一个应用程序,它使用
javax.microedition.rms.RecordStore
存储持久数据。我正在Gentoo上用NetBeans 6.0和J2ME 2.2开发这个项目。当我试图运行项目时,我得到一个错误,因为显然无法创建记录存储。下面是一个输出示例,包括堆栈跟踪:

jar: pre-run: cldc-run: Copying 1 file to /home/dzaslavs/ellipsix/programming/cataschedule/dist/nbrun1623864904410254936 Copying 1 file to /home/dzaslavs/ellipsix/programming/cataschedule/dist/nbrun1623864904410254936 Jad URL for OTA execution: http://localhost:8082/servlet/org.netbeans.modules.mobility.project.jam.JAMServlet/home/dzaslavs/ellipsix/programming/cataschedule/dist//CATASchedule.jad Starting emulator in execution mode Running with storage root rms javax.microedition.rms.RecordStoreException: error opening record store file at javax.microedition.rms.RecordStore.(RecordStore.java:2150) at javax.microedition.rms.RecordStore.openRecordStore(RecordStore.java:208) at net.ellipsix.cata.StopRecordStore.(StopRecordStore.java:48) at net.ellipsix.cata.CATAMIDlet.getStopList(CATAMIDlet.java:169) at net.ellipsix.cata.CATAMIDlet.startMIDlet(CATAMIDlet.java:64) at net.ellipsix.cata.CATAMIDlet.startApp(CATAMIDlet.java:449) at javax.microedition.midlet.MIDletProxy.startApp(MIDletProxy.java:44) at com.sun.midp.midlet.Scheduler.schedule(Scheduler.java:372) at com.sun.midp.main.Main.runLocalClass(Main.java:461) at com.sun.midp.main.Main.main(Main.java:126) 因此,这表明NetBeans尝试创建记录存储文件时会触发IOException。但为什么会这样呢?不幸的是,输出没有说明记录存储创建失败的确切原因。有人知道可能出了什么问题,或者知道NetBeans如何在内部处理
RecordStore
s吗

以下是我的代码中触发错误的构造函数(如果相关):

public StopRecordStore() throws RecordStoreException {
    this.store = RecordStore.openRecordStore("freqstops", true);
    if (store.getNumRecords() == 0) {
        try {
            byte[] collegeAllen = new StopRecord((short)1, "College & Allen").toBytes();
            store.addRecord(collegeAllen, 0, collegeAllen.length);
        }
        catch(IOException ioe) {
            ioe.printStackTrace();
        } // do nothing
    }
}
编辑:…10小时后没有答案?真的吗?

我运行了strace netbeans-6.0,观察在应用程序抛出错误时输出中出现的文件名

strace netbeans-6.0 [pid 10593] stat64("/opt/sun-j2me-bin-2.2/bin/./../appdb/rms/run_by_class_storage_freqstops.db", 0xbfa475c0) = -1 ENOENT (No such file or directory) [pid 10593] open("/opt/sun-j2me-bin-2.2/bin/./../appdb/rms", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80000) = -1 ENOENT (No such file or directory) [pid 10593] stat64("/opt/sun-j2me-bin-2.2/bin/./../appdb/rms", 0xbfa475d0) = -1 ENOENT (No such file or directory) [pid 10593] mkdir("/opt/sun-j2me-bin-2.2/bin/./../appdb/rms", 0777) = -1 EACCES (Permission denied) [pid 10593]stat64(“/opt/sun-j2me-bin-2.2/bin/。/appdb/rms/run\u by\u class\u storage\u freqstops.db”,0xbfa475c0)=-1 enoint(无此类文件或目录) [pid 10593]打开(“/opt/sun-j2me-bin-2.2/bin/。/appdb/rms”,O|RDONLY | O|NONBLOCK | O| LARGEFILE | O|u DIRECTORY | 0x80000)=-1 enoint(无此类文件或目录) [pid 10593]stat64(“/opt/sun-j2me-bin-2.2/bin/。/appdb/rms”,0xbfa475d0)=-1 enoint(无此类文件或目录) [pid 10593]mkdir(“/opt/sun-j2me-bin-2.2/bin/。/appdb/rms”,0777)=-1 EACCES(权限被拒绝) 手动创建目录
/opt/sun-j2me-bin-2.2/appdb/rms
chmod
将其定为0777解决了问题

[pid 10593] stat64("/opt/sun-j2me-bin-2.2/bin/./../appdb/rms/run_by_class_storage_freqstops.db", 0xbfa475c0) = -1 ENOENT (No such file or directory) [pid 10593] open("/opt/sun-j2me-bin-2.2/bin/./../appdb/rms", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|0x80000) = -1 ENOENT (No such file or directory) [pid 10593] stat64("/opt/sun-j2me-bin-2.2/bin/./../appdb/rms", 0xbfa475d0) = -1 ENOENT (No such file or directory) [pid 10593] mkdir("/opt/sun-j2me-bin-2.2/bin/./../appdb/rms", 0777) = -1 EACCES (Permission denied)