| Issue 43: | my application crash after trying to write smth in RecordStore | |
| 2 people starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1.Start my application in the emulator (jar not-web based) 2.I can use it, on a screen where there is a lot of loadings application freezes, no error messages, juste freeze. But i think that is normal... ? 3.If i generate a web-based version, at the start of the application i got an error in console : Exception in thread "event-thread" java.lang.NullPointerException at java.io.DataOutputStream.writeUTF(Unknown Source) at java.io.DataOutputStream.writeUTF(Unknown Source) at g.a(Unknown Source) at mt.MTPOS.saveConf(Unknown Source) at al.commandAction(Unknown Source) at ad.keyPressed(Unknown Source) at javax.microedition.lcdui.Display$KeyEvent.run(Display.java:152) at org.microemu.device.ui.EventDispatcher.post(EventDispatcher.java:162) at org.microemu.device.ui.EventDispatcher.run(EventDispatcher.java:97) at java.lang.Thread.run(Unknown Source) basic: Starting applet teardown java.lang.NullPointerException at java.io.DataOutputStream.writeUTF(Unknown Source) at java.io.DataOutputStream.writeUTF(Unknown Source) at g.a(Unknown Source) at mt.MTPOS.saveConf(Unknown Source) at mt.MTPOS.exitMTPOS(Unknown Source) at mt.MTPOS.destroyApp(Unknown Source) at javax.microedition.midlet.MIDlet$MIDletAccessor.destroyApp(MIDlet.java:58) at org.microemu.applet.Main.destroy(Main.java:287) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) At this level, i'm just saving somth in the recordstore... What is the expected output? What do you see instead? Application does not crash ;) What version of the product are you using? On what operating system? tried with microemulator-2.0.4 & microemulator-3.0.0-SNAPSHOT Thanks in advance, and many thanks for your great job & community !
Apr 22, 2010
Project Member
#1
bar...@gmail.com
Apr 22, 2010
Yes i have access, i'm the main developper of it. I Actually don't know what is that
'g' object and that a method (smth obfuscated ?)
My application load and ask for the user language. After selection i put it in the
Config (a table in my record store) and update it.
Here is the code of saveConf() :
public static void saveConf() {
try {
MTPOS.debug("1");
Config.mappingRS = RecordStore.openRecordStore(ConfigRSName, true);
config.id = 1;
MTPOS.debug("2");
if (curAct != null) {
config.actID = curAct.id;
} else {
config.actID = -1;
}
MTPOS.debug("3");
if (curAvail != null) {
config.availId = curAvail.id;
} else {
config.availId = -1;
}
if (curShop != null) {
config.shopID = curShop.id;
} else {
config.shopID = -1;
}
MTPOS.debug("4");
//#ifdef Presence
if (curAddressPlanning != null) {
config.addressPlanningId = curAddressPlanning.id;
} else {
config.addressPlanningId = -1;
}
//#endif
config.language = Lng.getCurrentLanguage();
config.version = version;
if (config.getRecordID() == -1) {
MTPOS.debug("5");
config.bruteInsert();
MTPOS.debug("6");
} else {
config.update();
}
Config.mappingRS.closeRecordStore();
} catch (RecordStoreException ex) {
handleError("Problem with MTsyncConf record store.", ex);
return;
} catch (IOException ex) {
handleError("Problem with MTsyncConf record store.", ex);
return;
}
}
MTPOS.debug(String str) is a method that just make Sysout str with actual datetime.
Apr 22, 2010
And there is nothing printed in the console... Sysout isn't forwarded to java console ?
Apr 28, 2010
Still the key question is what is happening in the g.a() method and why DataOutputStream.writeUTF argument is null. Exception in thread "event-thread" java.lang.NullPointerException at java.io.DataOutputStream.writeUTF(Unknown Source) at java.io.DataOutputStream.writeUTF(Unknown Source) at g.a(Unknown Source)
Apr 28, 2010
I Actually don't know what is that 'g' object and that 'a' method (smth obfuscated ?)
Apr 29, 2010
please, i really need your help and this is getting quite urgent. What can i do ?
Apr 29, 2010
Ok i found my problem. A problem with getAppProperty("MIDlet-Version");
Everything works.
I also found the #44 bug reported.
Apr 29, 2010
Very good
Status:
Invalid
|