Search code examples
netbeansjava-memidpwma

Authentication failed deploying a J2ME application to a cell phone


I have an application to send SMS with J2ME, I generate a JAR file and a signed JAD file, I can install and run my app with the JAR file, but I get the "untrusted midlet" message, and I can't send sms, when I try I get this exception : wma : open denied.

And when I try to install the app with the JAD file, i get the error message "authentication failed", this file is created with netbeans, and this is its content:

MIDlet-1: smsapp,/res/smsapp.png,ptfs.smsapp
MIDlet-Certificate-1-1: MIIBmzCCAQSgAwIBAgIET6fZJzANBgkqh.....
MIDlet-Jar-RSA-SHA1: Pd68O3nDyskfRQHeAo......
MIDlet-Jar-Size: 765890
MIDlet-Jar-URL: smsapp.jar
MIDlet-Name: smsapp
MIDlet-Permissions: javax.wireless.messaging.sms.send
MIDlet-Vendor: Vendor
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.1
MicroEdition-Profile: MIDP-2.0

and this is my code to send the sms :

MessageConnection mc;
String addr = "sms://6666";
try{
   mc = (MessageConnection)Connector.open(addr);
}catch(Exception e){
   return;
}
try{
   TextMessage textmessage = (TextMessage)mc.newMessage(MessageConnection.TEXT_MESSAGE);
   textmessage.setAddress(addr);
   textmessage.setPayloadText(smsContent.getText());
   mc.send(textmessage);
}catch(Exception e){
   return;
}
try{
   if(mc != null)
       mc.close();
}catch(Exception e){
}

I am using the LG VU cell phone.


Solution

  • Rather than using NetBeans to sign it, use the free service @ http://www.j2start.com/p/sign-your-midlet.html, where you can sign it with a certificate that will be accepted by the phone.