×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Nov 2003
    Location
    Ireland
    Posts
    49

    calling midlet from midlet throws SecurityException on 6600

    Hi,
    I am trying to call one midlet from another midlet (both are part of the same midlet suite) on my 6600. This is documented as being possible with MIDP 2.0.
    However when doing so the code throws a SecurityException.
    Here is my code:

    try
    {
    Class c = Class.forName("BriansTestJ2MEApp.CameraHandler");
    MIDlet m = (MIDlet) c.newInstance();
    m.resumeRequest();
    }
    catch(Exception e){}

    The line:
    MIDlet m = (MIDlet) c.newInstance();
    is the one that throws the exception.

    The javadocs say:
    "MIDlet
    protected MIDlet() Protected constructor for subclasses.
    The application management software is responsible for creating MIDlets and creation of MIDlets is restricted. MIDlets should not attempt to create other MIDlets.
    Throws:
    SecurityException - unless the application management software is creating the MIDlet."

    However i believe from what I have read that it is possible to call a midlet from within another midlet with MIDP 2.0.
    Has anybody any suggestions here as to what im doing wrong??
    Thanks,
    Brian

  2. #2
    Super Contributor
    Join Date
    Mar 2003
    Location
    Israel
    Posts
    2,280
    The javadocs say:
    "MIDlet
    protected MIDlet() Protected constructor for subclasses.
    The application management software is responsible for creating MIDlets and creation of MIDlets is restricted. MIDlets should not attempt to create other MIDlets.
    Throws:
    SecurityException - unless the application management software is creating the MIDlet."
    You're answering your own question here.
    I suggest you look over your design. Is it really necessary for these components to be separate MIDlets? Couldn't you integrate them into on MIDlet? I assume this isn't the answer you wanted to hear but it's better than banging your head against the wall.

    However i believe from what I have read that it is possible to call a midlet from within another midlet with MIDP 2.0.
    Well, since the first quote comes straight from the MIDP 2.0 javadocs, I assume you read that wrong.

    shmoove

  3. #3
    Registered User
    Join Date
    Jun 2007
    Posts
    1

    Re: calling midlet from midlet throws SecurityException on 6600

    Hi, I have the following problem. I'm building some lines that I want to execute "before" the execution of a MIDlet. To do this by the best way I thought inheriting the main class and then change the startApp method. The problem was that some of my MIDlets declared startApp as "final", so I couldnt change it. My next choice was the idea of this thread about executing it from "outside". I have the same security exception, can I override it? I think there is no other way to execute something before the execution of this MIDlet.

    Thanks!!!!

  4. #4
    Registered User
    Join Date
    Sep 2009
    Location
    Bangalore, India
    Posts
    49

    Thumbs up Re: calling midlet from midlet throws SecurityException on 6600

    Quote Originally Posted by brianpegan View Post
    Hi,
    I am trying to call one midlet from another midlet (both are part of the same midlet suite) on my 6600. This is documented as being possible with MIDP 2.0.
    However when doing so the code throws a SecurityException.
    Here is my code:

    try
    {
    Class c = Class.forName("BriansTestJ2MEApp.CameraHandler");
    MIDlet m = (MIDlet) c.newInstance();
    m.resumeRequest();
    }
    catch(Exception e){}

    The line:
    MIDlet m = (MIDlet) c.newInstance();
    is the one that throws the exception.

    The javadocs say:
    "MIDlet
    protected MIDlet() Protected constructor for subclasses.
    The application management software is responsible for creating MIDlets and creation of MIDlets is restricted. MIDlets should not attempt to create other MIDlets.
    Throws:
    SecurityException - unless the application management software is creating the MIDlet."

    However i believe from what I have read that it is possible to call a midlet from within another midlet with MIDP 2.0.
    Has anybody any suggestions here as to what im doing wrong??
    Thanks,
    Brian
    Hi dude.. I have achieved the same in last two days.. u can do that by using push notification API. Do some RnD on the same. .. After all if u need my help i can surely help u out..
    Regards
    Nilanchala

Posting Permissions

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