×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    6

    continuously getting security exception

    Hey guys,
    I m getting this exception:
    java.lang.SecurityException: Application not authorized to access the restricted API
    at com.sun.midp.security.SecurityHandler.checkForPermission(), bci=275
    at com.sun.midp.security.SecurityHandler.checkForPermission(), bci=15
    at com.sun.midp.midletsuite.MIDletSuiteImpl.checkForPermission(), bci=40
    at com.sun.midp.midletsuite.MIDletSuiteImpl.checkForPermission(), bci=18
    at com.sun.midp.main.CldcAccessControlContext.checkPermissionImpl(), bci=71
    at com.sun.j2me.security.AccessControlContextAdapter.checkPermission(), bci=4
    at com.sun.j2me.security.AccessController.checkPermission(), bci=23
    at com.sun.j2me.security.AccessController.checkPermission(), bci=3
    at com.sun.midp.io.j2me.ssl.Protocol.openPrim(), bci=41
    at javax.microedition.io.Connector.openPrim(), bci=327
    at javax.microedition.io.Connector.open(), bci=3
    at javax.microedition.io.Connector.open(), bci=3
    at javax.microedition.io.Connector.open(), bci=2
    at a.Midlet.commandAction(Midlet.java:46)
    at javax.microedition.lcdui.Display$ChameleonTunnel.callScreenListener(), bci=46
    at com.sun.midp.chameleon.layers.SoftButtonLayer.processCommand(), bci=74
    at com.sun.midp.chameleon.layers.SoftButtonLayer.soft1(), bci=37
    at com.sun.midp.chameleon.layers.SoftButtonLayer.keyInput(), bci=36
    at com.sun.midp.chameleon.CWindow.keyInput(), bci=38
    at javax.microedition.lcdui.Display$DisplayEventConsumerImpl.handleKeyEvent(), bci=17
    at com.sun.midp.lcdui.DisplayEventListener.process(), bci=277
    at com.sun.midp.events.EventQueue.run(), bci=179
    at java.lang.Thread.run(Thread.java:662)

    what could be the problem??

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2011
    Posts
    555

    Re: continuously getting security exception

    Hi himanshu145,

    You are most likely attempting to use method calls that are protected. You would need to

    a) identify the protected method calls, then
    b) use the appropriate permissions in the file descriptor (.jad file) and finally
    c) sign the application.

    More information on using permissions inside the .jad file and signing a MIDlet can be found here.
    An example of how to access a protected method can be found in this library.

    Are you attempting to retrieve data via a secure connection or use authentication or access a smart card? Is your target a Nokia device?

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2003
    Posts
    4,105

    Re: continuously getting security exception

    In your method callScreenListener() of ChameleonTunnel, you are calling Connector.open("ssl://…
    This created a SecureConnection class internally. If your MIDlet is not signed, this exception happens because you use the wrong port: 443 (https) is reserved for a HttpConnection. You have to start your URL string with https:// or you sign you MIDlet. If you sign your MIDlet, you have to add ‘javax.microedition.io.Connector.ssl’ for the ‘MIDlet-Permissions-Opt’ attribute.

Similar Threads

  1. Security Exception
    By HasithaRandika in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2012-05-04, 20:40
  2. Replies: 2
    Last Post: 2011-05-12, 14:10
  3. ISO14443Connection Security Exception
    By Alex_Polt in forum Near Field Communication
    Replies: 37
    Last Post: 2009-07-21, 09:08
  4. Security exception
    By manojkumar.m in forum Mobile Java General
    Replies: 1
    Last Post: 2008-06-17, 10:33
  5. Security exception in JSR-75 api HELP!!URGENT!!!!
    By prats123 in forum Mobile Java General
    Replies: 7
    Last Post: 2008-04-24, 09:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •