SMS Midlet for Razr V3 - keep getting a SecurityException

I've kind of hacked my way through my first midlet to send an SMS and I keep getting the following error:

java.lang.SecurityException: was denied

The phone is a Razr V3, CLDC 1.0, MIDP 2.0.  The Java App Loader is unlocked so I've been transfering the app with Midway.  It runs through Sun's emulator but I've had some other issues with the Motorola one, so I cannot say whether or not it's working there.

From the JAD:
MIDlet-1: SMS, SMS.png, SMS
MIDlet-Jar-Size: 2980
MIDlet-Jar-URL: SMS.jar
MIDlet-Name: SMS
MIDlet-Vendor: bowline
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-2.0

The applicable source (I think):
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.wireless.messaging.*;
import java.util.*;
      public void sendMessage(final String addr, final String msg) {
            System.out.println("Message Start");
            Thread th = new Thread() {
                  public void run() {
                        try {
                              MessageConnection conn = (MessageConnection)"sms://+1" + addr);
                              TextMessage txtMsg = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
                              System.out.println("Message Sent");
                              mForm.append("...Sent Message");
                              } catch (Exception e) {
                                    mForm.append("...ERROR - " + e);

I've done some reading on the api and the implementation of it on this version of my phone, and from what I can tell JSR 120 is supported, and I should just have to deal with prompts asking me if it's okay that the app sends a message.  I've gone into the permissions on the application, and there's not even an option for messaging, just data access.  I feel like something is getting lost in translation - like when the application is installed, the phone does not know that it is going to try to access this api.  I've tried messing around (blindly) with the different types of permissions and opt-permissions on the midlet's settings with no luck so far.

1.  Can I send SMS messages with a Midlet on this version of my phone?
2.  Do I have to have a signed application to access the api? (this is just a personal project, so I'd rather not spend the money)
3.  What am I doing wrong?

Thanks in advance for any help!

(and I can post more code if necessary, but it mostly just has a text box where you type in the phone number and press send - just enough to test right now)
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

1. Yes.
2. It has to be signed to operate on the device. No way around it. You are accessing a protected API - it's like that in JSR 120
3. Probably nothing wrong with your code.

Excerpt From JSR 120:
For sending messages, the MessageConnection object provides factory methods for creating Message objects. For receiving messages, the MessageConnection supports an event listener-based receive mechanism, in addition to a synchronous blocking receive() method. *The methods for sending and receiving messages can throw a SecurityException if the application does not have the permission to perform these operations.*
bowlineAuthor Commented:

Thanks for the reply, but I seem to be getting conflicting information from different sources.  According to the documentation on the Razr V3, when dealing with unsigned/untrusted midlets, the phone will prompt the user for approval when a midlet tries to access the WMA.  The only API's that are outright denied access seem to be those that deal with personal information and contact management.  I've contacted Motorola support and they've told me that it works as documented but said that some carriers will put further restrictions on phones to prevent access to the API.  I contacted T-Mobile (my carrier) to see if this was the case and they said that they don't do anything additional.  Do you have any

So if I do have to go with the signing - is there a cheap/easy way to go through this?  Especially since this is a personal project and I'm hacking my way through it - I've got no idea how the signing would work.

What the SecurityException is saying is that the application doesn't have sufficient permission to perform the operation.
I don't know the Razr very well; perhaps you can manually allow the application to make these calls (app permissions perhaps?). Otherwise, you'd have to go through Motorola ( and get it signed.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bowlineAuthor Commented:
Sorry - I thought this was already deleted...tried to get to it a couple of weeks ago.

I'll award the points, but the solution was actually to flex the phone.  T-Mobile apparently locks down access to a lot of API's - so I reloaded the phone with another carrier's package (Orange) and it worked...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Wireless Networking

From novice to tech pro — start learning today.