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: 29
Registered: ‎12-28-2009
My Device: Not Specified

SMS sending : NullPointerException

Hello to all,

                i am working on one applicaion in which i have to send SMS through programme but whenever i am using the below code to send the message then i am getting the NullPointerException on Invoke.invokeApplication method.

TextMessage msgout;
MessageConnection msgcon;                    
msgcon = (MessageConnection)Connector.open("sms://");
msgout = (TextMessage) msgcon.newMessage(MessageConnection.TEXT_MESSAGE);
msgout.setPayloadText("I am busy. Call u later");
                            new MessageArguments(msgout));

can anybody tell me that what is the problem.

with thanks and regards

BlackBerry Development Advisor
Posts: 15,882
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: SMS sending : NullPointerException

Are you testing using BlackBerry device software version 5.0?  If so, please refer to the following issue in the Issue Tracker.


Null text message or payload when launching SMS window


Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Posts: 29
Registered: ‎12-28-2009
My Device: Not Specified

Re: SMS sending : NullPointerException



thanks msohm for ur reply.


sorry for incomplete information.

i am testing this application on 5.0 JDE simulator-9000. there it is giving the nullpointer exception at the time of Invoke.invokeApplication() method. what is going wrong.


plz try to help me.