My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
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
Status:  Invalid
Owner:  ----
Closed:  Apr 2010


 
Reported by Guillaum...@gmail.com, Apr 22, 2010
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
Do you have access to the source code of MIDlet? The most important is to know what
exactly method g.a is doing.
Apr 22, 2010
#2 Guillaum...@gmail.com
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
#3 Guillaum...@gmail.com
And there is nothing printed in the console... Sysout isn't forwarded to java console ?
Apr 28, 2010
Project Member #4 bar...@gmail.com
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
#5 Guillaum...@gmail.com
I Actually don't know what is that 'g' object and that 'a' method (smth obfuscated ?)

Apr 29, 2010
#6 Guillaum...@gmail.com
please, i really need your help and this is getting quite urgent. What can i do ?
Apr 29, 2010
#7 Guillaum...@gmail.com
Ok i found my problem. A problem with getAppProperty("MIDlet-Version");

Everything works.

I also found the #44 bug reported.
Apr 29, 2010
Project Member #8 bar...@gmail.com
Very good
Status: Invalid

Powered by Google Project Hosting