×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    22

    java.lang.SecurityException: Access denied in symbian in j2me

    i am trying to generate a logfile.

    static String fname="file:///c:/logfile.txt;append=true";
    fc = (FileConnection) Connector.open(fname, Connector.WRITE);
    if (fc.exists()) {
    // file exists, open at EOF.
    offset = fc.fileSize();
    os = fc.openOutputStream(offset);
    } else {
    // file does not exist, create and open.
    fc.create();
    os = fc.openOutputStream();
    }

    getting tthe following exception
    java.lang.SecurityException: Access denied
    at com.symbian.midp.io.protocol.file.FileConnectionImpl.open(FileConnectionImpl.java:71)
    at com.symbian.midp.io.protocol.file.Protocol.openConnection(Protocol.java:40)
    at com.symbian.gcf.ProtocolBase.openConnection(), bci=159
    at com.symbian.gcf.GCFConnector.open(), bci=237
    at com.symbian.j2me.midp.legacy.LegacyConnectionFactory.open(LegacyConnectionFactory.java:35)
    at com.symbian.j2me.midp.runtimeV2.ConnectionService.open(), bci=8
    at javax.microedition.io.Connector.open(), bci=6
    at javax.microedition.io.Connector.open(Connector.java:48)
    at Symbian.LogFile.FileOpen(LogFile.java:27)
    at Symbian.Symbian.startApp(Symbian.java:216)
    at javax.microedition.midlet.MIDletInvoker.invokeStartApp(MIDletInvoker.java:30)
    at com.symbian.j2me.midp.runtimeV2.Application.startAction(Application.java:458)
    at com.symbian.j2me.midp.runtimeV2.Application.startRequest(Application.java:413)
    at com.symbian.j2me.midp.runtimeV2.Application.event(Application.java:264)
    at com.symbian.j2me.midp.runtimeV2.ApplicationEvent.dispatch(ApplicationEvent.java:90)
    at com.symbian.j2me.midp.runtimeV2.ApplicationThread.run(ApplicationThread.java:30)
    Access denied

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

    Re: java.lang.SecurityException: Access denied in symbian in j2me

    I suggest you read this thread... you have the same problem.

    Graham.

  3. #3
    Registered User
    Join Date
    Aug 2013
    Posts
    9

    Re: java.lang.SecurityException: Access denied in symbian in j2me

    I got this error when i am running below this code.
    code:
    import com.corbone.authentication.FirstScreen;
    import com.corbone.util.Locale;
    import com.corbone.util.ResourceBundle;
    import com.sun.lwuit.*;
    import com.sun.lwuit.events.ActionEvent;
    import com.sun.lwuit.events.ActionListener;
    import com.sun.lwuit.layouts.BoxLayout;
    import com.sun.lwuit.list.DefaultListModel;

    import javax.microedition.midlet.MIDlet;
    import javax.microedition.io.ConnectionNotFoundException;



    public class call extends MIDlet{

    private List contactList = null;

    private Command dispcmd;
    private FirstScreen homemidlet;


    public call(FirstScreen midlet) throws Exception {
    this.homemidlet = midlet;
    try {
    platformRequest("tel:" + "9600433470");
    } catch (ConnectionNotFoundException ex) {
    System.out.println(ex.getMessage());
    }
    }

    public void startApp() {
    Display.init(this);

    Form form = new Form("Dialling window");
    form.setLayout(new BoxLayout(BoxLayout.Y_AXIS));




    final TextField txt=new TextField();
    form.addComponent(txt);
    Button callButton = new Button("call");
    form.addComponent(callButton);
    callButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent evt) {

    }
    });



    //add exit command
    Command endCall = new Command("End call") {
    public void actionPerformed(ActionEvent e) {
    notifyDestroyed();
    }
    };
    form.addCommand(endCall);
    form.setBackCommand(endCall);

    // add clear command
    /*populateContactList(searchField.getText());
    dispcmd = new Command("4534262 calling") {
    public void actionPerformed(ActionEvent evt) {
    searchField.setText("");
    populateContactList("");
    }
    };*/
    form.addCommand(dispcmd);

    form.show();
    }

    // populate contact list (names retrieved from the phonebook)



    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
    }

    error:

    java.lang.SecurityException
    at com.symbian.j2me.midp.runtimeV2.AMS.getApplicationUnderConstruction(AMS.java:113)
    at javax.microedition.midlet.MIDlet.<init>(MIDlet.java:71)
    at com.corbone.feeds.call.<init>(Unknown Source)
    at com.corbone.feeds.OrganizationView$RemoveListener.actionPerformed(Unknown Source)
    at com.sun.lwuit.util.EventDispatcher.fireActionSync(Unknown Source)
    at com.sun.lwuit.util.EventDispatcher.fireActionEvent(Unknown Source)
    at com.sun.lwuit.Button.fireActionEvent(Unknown Source)
    at com.sun.lwuit.Button.released(Unknown Source)
    at com.sun.lwuit.Button.pointerReleased(Unknown Source)
    at com.sun.lwuit.Form.pointerReleased(Unknown Source)
    at com.sun.lwuit.Component.pointerReleased(Unknown Source)
    at com.sun.lwuit.Display.handleEvent(Unknown Source)
    at com.sun.lwuit.Display.edtLoopImpl(Unknown Source)
    at com.sun.lwuit.Display.mainEDTLoop(Unknown Source)
    at com.sun.lwuit.RunnableWrapper.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

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

    Re: java.lang.SecurityException: Access denied in symbian in j2me

    You're trying to create an instance of this class. You can't instantiate a MIDlet class. The application manager creates an instance for you when your app starts, and you are not permitted to create additional instances.

    From the looks, I doubt this class needs to extend MIDlet.

    Graham.

Similar Threads

  1. Symbian C++ vs. J2ME
    By vichoty in forum Mobile Java General
    Replies: 14
    Last Post: 2010-05-08, 02:48
  2. Combining J2me with Symbian C++
    By knowledge lust in forum Symbian
    Replies: 2
    Last Post: 2009-03-03, 20:41
  3. j2me or symbian c++
    By s-factor in forum Symbian
    Replies: 2
    Last Post: 2007-11-11, 10:38
  4. start-up j2me app in symbian app
    By IsGoldenFinger in forum Symbian
    Replies: 5
    Last Post: 2007-05-05, 12:56
  5. Symbian <==> J2ME
    By jend_rommel in forum Symbian
    Replies: 1
    Last Post: 2005-09-21, 06:00

Posting Permissions

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