can not read message when MIDlet started by push

Hi

I have a MIDlet which reads incoming messages and stores them in recordStore.When I start application manually everything is ok, MIDlet reads the message and stores it. But if it is started from push with received message, it starts but takes no action when messages are received. I have struggling with this for 3 days, could you please help me.

Cheers

[376 byte] By [gerekbolsaa] at [2007-11-27 4:59:45]
# 1
what is the difference between manual and automatic logic?are you sure that automatic initialization do the same as the manual?
suparenoa at 2007-7-12 10:16:06 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
how do I differ them?Dont they both call startApp()?
gerekbolsaa at 2007-7-12 10:16:06 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
> how do I differ them?i don't know, i didn't write your code !> Dont they both call startApp()?i don't know, it was just few questions. you may do something different...
suparenoa at 2007-7-12 10:16:06 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4

Hi

After some debugginf I have found that I have an exception here:

try{

smsconn = (MessageConnection)Connector.open(smsConnection);

smsconn.setMessageListener(this);

smsListener = new SMSListener(getAppProperty("SMS-Port"),this,smsconn);

new Thread(smsListener).start();

}catch(IOException ioe){

Alert alert = new Alert("Exception in starting messagelistener","Null pointer exception",null,AlertType.WARNING);

alert.setTimeout(Alert.FOREVER);

getDisplay().setCurrent(alert);

System.err.println("SQLException: " +ioe);

}catch(NullPointerException ex){

Alert alert = new Alert("Null Ptr exception","Null pointer exception " ,"null pointer exception is thrown" ,null,AlertType.WARNING);

alert.setTimeout(Alert.FOREVER);

getDisplay().setCurrent(alert);

}

some how null pointer exception is thrown when midlet is started by push not manually. When it is started manually everything goes fine. I guess setMessageListener throws this exception but i dont know why. Do you have any idea.

gerekbolsaa at 2007-7-12 10:16:06 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5

read [url=http://forum.java.sun.com/help.jspa?sec=formatting]this[/url] before posting ...

i need more info to understand why the NullPointerException is thrown (not all your app

please but the suspicious code!)

did you read this?

http://www.blackberry.com/developers/docs/4.1api/javax/wireless/messaging/MessageListener.html#example

suparenoa at 2007-7-12 10:16:06 > top of Java-index,Java Mobility Forums,Java ME Technologies...