×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    52

    Question About Illegal attempt to construct RecordStoreData

    Hello All,

    I have developed an application for mobile device. But when i am deploying this application in my mobile device, i am getting Security java/lang/SecurityException MIDlet Manager ERROR: Illegal attempt to construct RecordStoreData error. I am not getting what is problem and how can i resolve it. plz any one tell me what is problem and how can i solve it. In my code i am also using recordStore. My code is working properly on simulator.

    ThanksWithRegards
    abhi4u

  2. #2
    Nokia Developer Champion
    Join Date
    Sep 2007
    Posts
    915

    Re: About Illegal attempt to construct RecordStoreData

    Quote Originally Posted by abhi4u View Post
    Hello All,

    I have developed an application for mobile device. But when i am deploying this application in my mobile device, i am getting Security java/lang/SecurityException MIDlet Manager ERROR: Illegal attempt to construct RecordStoreData error. I am not getting what is problem and how can i resolve it. plz any one tell me what is problem and how can i solve it. In my code i am also using recordStore. My code is working properly on simulator.

    ThanksWithRegards
    abhi4u
    can you tell us on which device you are installing application ? Did you check the security settings in device ?

  3. #3
    Super Contributor
    Join Date
    Sep 2008
    Location
    Noida, U.P.
    Posts
    1,330

    Thumbs up Re: About Illegal attempt to construct RecordStoreData

    Hi,
    can u post ur code here.
    mention ur device make,model too.
    thanks,
    jitu_goldie..

    KEEP TRYING..

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: About Illegal attempt to construct RecordStoreData

    Hi,
    Please provide the answer the asked queries and also can you please try to install the same application on the other device...are you able to run this application on the emulator...
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: About Illegal attempt to construct RecordStoreData

    You are attempting to instantiate a class that extends MIDlet. For example:

    Code:
    RecordStoreData rsd = new RecordStoreData();
    Where:

    Code:
    public class RecordStoreData extends MIDlet {
        // ...
    }
    Only the platform should construct MIDlets.

    Cheers,
    Graham.

  6. #6
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    121

    Re: About Illegal attempt to construct RecordStoreData

    Hi Graham,

    I also encountered similar thing. My observation was it ran fine on S60 5th Edition simulator. But when i installed on phone, it threw similar exception mentioned in thread.

    Can you give little more insight what is the reason?

    I need to pass MIdlet instance to another Class which extends Form. I need to call notifyDestroyed() method to close the MIDlet. I had used

    Code:
    public static SampleMidlet sampleMidlet = new SampleMidlet();
    How can i pass the MIDlet instance to another Form?

    Thanks,
    Sandeep

  7. #7
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: About Illegal attempt to construct RecordStoreData

    Don't create a new MIDlet object. You need to use the MIDlet object that already exists.

    For example, if your Form is like:

    Code:
    public class MyForm extends Form {
        private MIDlet midlet;
    
        public MyForm(MIDlet m) {
            midlet = m;
        }
    }
    You can pass a reference to the midlet like:

    Code:
    public class MyMIDlet extends MIDlet {
        public void startApp() {
            Form f = new MyForm(this);
        }
    }
    Does that help?

    Graham.

  8. #8
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    121

    Re: About Illegal attempt to construct RecordStoreData

    Thanks Graham,

    Surely helps . And as you mentioned "Only the platform should construct MIDlets". That's why security exception is coming.

    Security things are not applicable in Simulator?

    Best regards,
    Sandeep

  9. #9
    Registered User
    Join Date
    Dec 2005
    Location
    Brazil
    Posts
    1,884

    Re: About Illegal attempt to construct RecordStoreData

    Hi,

    Graham is completely right, your MIDlet must be created by the AMS/JAM software on the phone, which is the execution environment for MIDlets (container) as usual. If you are not aware of it, I advise you to read about the MIDlet lifecycle, interaction with AMS and MIDlet states.

    http://developers.sun.com/mobility/a...es/#life-cycle

    Br,
    Juarez Alvares Barbosa Junior - Brazil

  10. #10
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: About Illegal attempt to construct RecordStoreData

    Quote Originally Posted by sandeepkumar03 View Post
    Security things are not applicable in Simulator?
    It's a difference in the implementation. Different emulators, different devices, they all behave slightly differently.

    Graham.

  11. #11
    Regular Contributor
    Join Date
    Oct 2008
    Posts
    121

    Re: About Illegal attempt to construct RecordStoreData

    Thanks Juarez and Graham

    Graham, i have had discussion with you in some threads. I appreciate your patience for taking time to answer in detail

    Best regards,
    Sandeep

Similar Threads

  1. *WARNING* Check Mosh for illegal copies of your software
    By svdwal in forum Feedback - Nokia Developer Services & Infrastructure
    Replies: 1
    Last Post: 2008-06-10, 16:21
  2. Exception on first attempt to connect in 6070
    By joaogalli in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2007-11-30, 11:52
  3. Replies: 8
    Last Post: 2007-05-10, 08:27
  4. What is Illegal Capability
    By Roose in forum Symbian
    Replies: 2
    Last Post: 2006-03-09, 15:07
  5. Illegal Argument Exception whe calling getPixels()
    By hardwik in forum Mobile Java General
    Replies: 0
    Last Post: 2003-03-02, 06:39

Posting Permissions

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