Applet Permissions - lang.java.RuntimePermission exitVM.0

Hello All,
I am new to java and working on java applet. I have an applet, of which functionality I wanted to extend in my java class. The applet requires so many permissions, which I have added in .java.policy file through java policy tool. But unfortunately it giving me following exception:
java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM.0)
     at java.security.AccessControlContext.checkPermission(Unknown Source)
     at java.security.AccessController.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkExit(Unknown Source)
     at javax.swing.JFrame.setDefaultCloseOperation(Unknown Source)
     at SketchApplet_new.createAndShowGUI(SketchApplet_new.java:56)
     at SketchApplet_new.init(SketchApplet_new.java:45)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
I have added the java.lang.RuntimePermission exitVM but it is throwing an exception for exitVM.0, which I haven't got in policy tool.
Please help me to add this permission to allow my applet execute properly.

I'm having the same problem i've used this tutorial to sign the jar file http://forums.sun.com/thread.jspa?threadID=174214, and i'm not being able to solve the problem

Similar Messages

  • How to load a java card applet into a java card

    Dear All,
    I am a novice to java card technology..
    I have done some search on how to load a java card applet into a smart card but haven't found a satisfactory answer. I have read about installer.jar and scriptgen tool but I want to load the applet from a java program and not from command line. It would be of great help if somebody can help me out.
    If somebody can share a sample program which load a javacard applet(.CAP file) into a smart card, I will be very thankful.
    I am able to find some client applications which help us send APDU commands and recieve response APDU's to interact with an applet loaded on to the smart card but not application which actually load the applet.
    I have heard of OCF and GP.. some say that OCF technology is outdated and no longer in use.. can somebosy throw some light on this too..
    cheers,
    ganesh

    hi siavash,
    thanks for the quick response.. i checked out GPShell as suggested, it looked like a tool by which one can load an applet on to card and send some sample apdu commands... but I want to load the applet from the code.
    My application should look something like this.. it will be a swing applicaton where I have a drop down with a list of readers, I select the one desired and then click on "LOAD" after inserting a blank java card, at this point my applet which is stored in my DB should get loaded on to the java card. The next step should be to personalize it where I enter the values for the static variables of my applet and click "PERSONALIZE", at this point all these values should be embedded into APDU commands and sent to the java card for processing.
    For achieving this I am yet to find a comprehensive sample or documentation on the net.
    Please help...
    regards,
    ganesh

  • �� I have a java applet program (yanhua.java) need help!!!

    �� I have a java applet program (yanhua.java) that use mouse click a area show a fireworks, the applet program that a java fan mail me. Now i find some bug in the program, can you help me? thank in advance!
    The backdrop of the question: The yanhua.java applet program works well. But one day, i install j2re 1.4.1 plugin for my microsfot Internet Explorer, i run the yanhua.java applet program again, it show difficult(i move my mouse in the area, slowness), the fireworks is not fluent. Then i try my best to find the cause , i get some information, the following: yanhua.java run in j2re 1.4.1 plugin,it will deplete 100% cpu; else yanhua.java does not run in j2re 1.4.1 plugin, it will deplete 90%--95% cpu too; but my computer c3 1G cpu and 256MB memory, without running other program at that time. So i can have the assurance to say that the yanhua.java have some bug or error. can you help me to find all bug in yanhua.java? thank you very much!!!
    i want to solve the question: finding all bug in yanhua.java
    NOTE:
    1��fireworks show specially good effect(a yanhua.java applet) you can look at:
    http://www.3ren.net/down/java/yanhua.html
    2��all program you can get from http://www.3ren.net/down/java/yanhua.rar
    /*************************yanhua.java******************************
    import java.applet.Applet;
    import java.applet.AudioClip;
    import java.awt.*;
    import java.awt.image.MemoryImageSource;
    import java.util.Random;
    public class yanhua extends Applet
    implements Runnable
    private int m_nAppX;
    private int m_nAppY;
    private int m_centerX;
    private int m_centerY;
    private int m_mouseX;
    private int m_mouseY;
    private int m_sleepTime;
    private boolean isError;
    private boolean m_isPaintFinished;
    boolean isRunning;
    boolean isInitialized;
    Thread runner;
    int pix0[];
    MemoryImageSource offImage;
    Image dbImg;
    int pixls;
    int pixls2;
    Random rand;
    int bits;
    double bit_px[];
    double bit_py[];
    double bit_vx[];
    double bit_vy[];
    int bit_sx[];
    int bit_sy[];
    int bit_l[];
    int bit_f[];
    int bit_p[];
    int bit_c[];
    int bit_max;
    int bit_sound;
    int ru;
    int rv;
    AudioClip sound1;
    AudioClip sound2;
    public yanhua()
    m_mouseX = 0;
    m_mouseY = 0;
    m_sleepTime = 5;
    isError = false;
    isInitialized = false;
    rand = new Random();
    bits = 10000;
    bit_px = new double[bits];
    bit_py = new double[bits];
    bit_vx = new double[bits];
    bit_vy = new double[bits];
    bit_sx = new int[bits];
    bit_sy = new int[bits];
    bit_l = new int[bits];
    bit_f = new int[bits];
    bit_p = new int[bits];
    bit_c = new int[bits];
    ru = 50;
    rv = 50;
    public void init()
    String s = getParameter("para_bits");
    if(s != null)
    bits = Integer.parseInt(s);
    s = getParameter("para_max");
    if(s != null)
    bit_max = Integer.parseInt(s);
    s = getParameter("para_blendx");
    if(s != null)
    ru = Integer.parseInt(s);
    s = getParameter("para_blendy");
    if(s != null)
    rv = Integer.parseInt(s);
    s = getParameter("para_sound");
    if(s != null)
    bit_sound = Integer.parseInt(s);
    m_nAppX = this.getSize().width;
    m_nAppY = this.getSize().height;
    m_centerX = m_nAppX / 2;
    m_centerY = m_nAppY / 2;
    m_mouseX = m_centerX;
    m_mouseY = m_centerY;
    resize(m_nAppX, m_nAppY);
    pixls = m_nAppX * m_nAppY;
    pixls2 = pixls - m_nAppX * 2;
    pix0 = new int[pixls];
    offImage = new MemoryImageSource(m_nAppX, m_nAppY, pix0, 0, m_nAppX);
    offImage.setAnimated(true);
    dbImg = createImage(offImage);
    for(int i = 0; i < pixls; i++)
    pix0[i] = 0xff000000;
    sound1 = getAudioClip(getDocumentBase(), "firework.au");
    sound2 = getAudioClip(getDocumentBase(), "syu.au");
    for(int j = 0; j < bits; j++)
    bit_f[j] = 0;
    isInitialized = true;
    start();
    public void run()
    while(!isInitialized)
    try
    Thread.sleep(200L);
    catch(InterruptedException interruptedexception) { }
    do
    for(int j = 0; j < pixls2; j++)
    int k = pix0[j];
    int l = pix0[j + 1];
    int i1 = pix0[j + m_nAppX];
    int j1 = pix0[j + m_nAppX + 1];
    int i = (k & 0xff0000) >> 16;
    int k1 = ((((l & 0xff0000) >> 16) - i) * ru >> 8) + i;
    i = (k & 0xff00) >> 8;
    int l1 = ((((l & 0xff00) >> 8) - i) * ru >> 8) + i;
    i = k & 0xff;
    int i2 = (((l & 0xff) - i) * ru >> 8) + i;
    i = (i1 & 0xff0000) >> 16;
    int j2 = ((((j1 & 0xff0000) >> 16) - i) * ru >> 8) + i;
    i = (i1 & 0xff00) >> 8;
    int k2 = ((((j1 & 0xff00) >> 8) - i) * ru >> 8) + i;
    i = i1 & 0xff;
    int l2 = (((j1 & 0xff) - i) * ru >> 8) + i;
    int i3 = ((j2 - k1) * rv >> 8) + k1;
    int j3 = ((k2 - l1) * rv >> 8) + l1;
    int k3 = ((l2 - i2) * rv >> 8) + i2;
    pix0[j] = i3 << 16 | j3 << 8 | k3 | 0xff000000;
    rend();
    offImage.newPixels(0, 0, m_nAppX, m_nAppY);
    try
    Thread.sleep(m_sleepTime);
    catch(InterruptedException interruptedexception1) { }
    } while(true);
    public void update(Graphics g)
    paint(g);
    public void paint(Graphics g)
    g.drawImage(dbImg, 0, 0, this);
    public void start()
    if(isError)
    return;
    isRunning = true;
    if(runner == null)
    runner = new Thread(this);
    runner.start();
    public void stop()
    if(runner != null)
    runner.stop();
    runner = null;
    public boolean mouseMove(Event event, int i, int j)
    m_mouseX = i;
    m_mouseY = j;
    return true;
    public boolean mouseDown(Event event, int i, int j)
    m_mouseX = i;
    m_mouseY = j;
    int k = (int)(rand.nextDouble() * 256D);
    int l = (int)(rand.nextDouble() * 256D);
    int i1 = (int)(rand.nextDouble() * 256D);
    int j1 = k << 16 | l << 8 | i1 | 0xff000000;
    int k1 = 0;
    for(int l1 = 0; l1 < bits; l1++)
    if(bit_f[l1] != 0)
    continue;
    bit_px[l1] = m_mouseX;
    bit_py[l1] = m_mouseY;
    double d = rand.nextDouble() * 6.2800000000000002D;
    double d1 = rand.nextDouble();
    bit_vx[l1] = Math.sin(d) * d1;
    bit_vy[l1] = Math.cos(d) * d1;
    bit_l[l1] = (int)(rand.nextDouble() * 100D) + 100;
    bit_p[l1] = (int)(rand.nextDouble() * 3D);
    bit_c[l1] = j1;
    bit_sx[l1] = m_mouseX;
    bit_sy[l1] = m_nAppY - 5;
    bit_f[l1] = 2;
    if(++k1 == bit_max)
    break;
    if(bit_sound > 1)
    sound2.play();
    return true;
    public boolean mouseExit(Event event, int i, int j)
    m_mouseX = i;
    m_mouseY = j;
    return true;
    void rend()
    boolean flag = false;
    boolean flag1 = false;
    boolean flag2 = false;
    for(int k = 0; k < bits; k++)
    switch(bit_f[k])
    default:
    break;
    case 1: // '\001'
    bit_vy[k] += rand.nextDouble() / 50D;
    bit_px[k] += bit_vx[k];
    bit_py[k] += bit_vy[k];
    bit_l[k]--;
    if(bit_l[k] == 0 || bit_px[k] < 0.0D || bit_py[k] < 0.0D || bit_px[k] > (double)m_nAppX || bit_py[k] > (double)(m_nAppY - 3))
    bit_c[k] = 0xff000000;
    bit_f[k] = 0;
    } else
    if(bit_p[k] == 0)
    if((int)(rand.nextDouble() * 2D) == 0)
    bit_set((int)bit_px[k], (int)bit_py[k], -1);
    } else
    bit_set((int)bit_px[k], (int)bit_py[k], bit_c[k]);
    break;
    case 2: // '\002'
    bit_sy[k] -= 5;
    if((double)bit_sy[k] <= bit_py[k])
    bit_f[k] = 1;
    flag2 = true;
    if((int)(rand.nextDouble() * 20D) == 0)
    int i = (int)(rand.nextDouble() * 2D);
    int j = (int)(rand.nextDouble() * 5D);
    bit_set(bit_sx[k] + i, bit_sy[k] + j, -1);
    break;
    if(flag2 && bit_sound > 0)
    sound1.play();
    void bit_set(int i, int j, int k)
    int l = i + j * m_nAppX;
    pix0[l] = k;
    /*********************************end*******************************

    no one help me???????????

  • For save applet window in java

    In my project i want to save applet window.
    So please tell me how can i save and open applet window in java.
    If possible than also send the source code to save applet window.
    Thanx

    in Java 6u10 it works?
    I guess it's similar. My applet calls showDocument(), but it is only passing a URL with query string parameters which the page called reads (via Javascript) and uses JS to call window.open() with the contents based on those parameters. I don't have access to the system to change the way the web works. The team that does has looked into it, and said they do make the tofront call in JS to push the browser window up. But it won't go up all the way, only above other browser windows, and not the applet window (which is a JFrame). Then the OS (windows in this case) starts blinking the taskbar button for the popup window for attention, but that's not helpful.
    The only common factor in the reports were that it's Java 6u10 or higher. XP, Vista, FF, IE, all had the problem with 6u10+. And knowing how Sun changed the plug-in architecture, it actually makes some sense as to why this happens. However, this seems to be something that there is no way to fix short of Sun doing something. Or as mentioned, minimize my window just to let others show up, which is going to be annoying as a user to have to restore the window to go back.

  • How to set applet  parameter in java code?

    Hi All,
    Instead of setting applet parameters in JSP page, Now I have a need to set
    applet parameters in java code. But I can't find a method that allow me to do this. There
    is only getParameter but seems no setParameter method.
    Any help is appreaciated.
    Thanks,
    Chris

    Take a look at set_custom_property:
    public static final ID SETTEXT = ID.registerProperty("SETTEXT");
    public boolean setProperty(ID pid, Object value)
        if (pid == SETTEXT)
    String text = value.toString();
    and in forms
    set_custom_property('beans.bean_item', 1, 'SETTEXT', 'some text');
    cheers

  • BugReport: Berkeley DB 6.1.19 lang/java/libdb_java/db_java_wrap.c

    When using Berkeley DB 6.1.19. with Java API (JNI) there is a bug that prevents users from calling "Environment.lockVector()":
    Setting a lock timeout for the LockRequest and defining "LockRequestMode.GET_TIMEOUT" is not correctly mapped in the JNI implementation. Instead of setting "timeout", "op" is getting set. I found the error and fixed it for my local Installation:
    source file: lang/java/libdb_java/db_java_wrap.c line 1868 (Java_com_sleepycat_db_internal_db_1javaJNI_DbEnv_1lock_1vec):
    wrong:
    case DB_LOCK_GET_TIMEOUT:
        /* Needed: mode, timeout, obj. Returned: lock. */
    prereq->op = (db_lockop_t)(*jenv)->GetIntField(
            jenv, jlockreq, lockreq_timeout_fid);
    must be fixed to:
    prereq->timeout = (db_lockop_t)(*jenv)->GetIntField(
            jenv, jlockreq, lockreq_timeout_fid);

    Hi,
    Thanks for reporting the issue.
    We will take a look and  fix it if there is a bug here.
    Regards,
    Winter, Oracle Berkeley DB

  • How to add scroll function in  the applet launched by  Java Web Start?

    I have Java Web Start installed in order for the applet to launch.The applet size: width:700 height:1000
    my compuer resolution:800*600
    the applet launched by Java Web Start can only be seen partly,especially height.How to add scroll function in the applet launched by Java Web Start?
    Thanks for help.
    email:[email protected]

    You can very easily add a JScrollPane manually between the Applet and your content. Perhaps it would be beter if javaws did this automatically. In the browser, an applet can be any size. In Java Web Start an applet is directly contained within a JFrame, so it cannot be smaller than the minimum size of a JFrame, or Larger than the max.

  • File access Permissions in Java

    when the user select the file chooser button and browse through the directory in the local file system. If the user chooses any folder and that folder has readOnly access permission then the user can't copy the file into that folder as it has only Read access. So Please tell me how to give file and drive permissions in java on windows.

    File.setReadable() and friends, but "The operation will fail if the user does not have permission to change the access permissions of this abstract pathname." Check the return code.

  • Granting permissions for JAVA STORED PROCS

    If I imported a java class file as user test and created a stored proc, how can I grant permissions to all the users in the DB? Do I have to grant permissions on JAVA CLASS itself when I load it or Do I have to grant permissions on the Stored proc or Both?
    Any help will be greatly appreciated.
    null

    Note: I can manually add the file with the command -
    loadjava -v -user user/password@sid sqljdbc.jar (pg 261 in Oracle Database Programming using Java and Web Services by Kuassi Mensah)
    Which is what I have done to get this to work. But the question still stands - How do I get the sqljdbc.jar file to be loaded when deployed using the deployment descriptor?
    Thanks, Ken

  • Permissions in Java

    I was reading up on file permissions in java at http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html
    I would like to know whether these permissions are for use only within Java or do they apply externally aswell.
    I mean if I dont allow write permission in my program and my program is currently running, then can the user still write to the file by opening it outside normally?
    Thanks.

    Note: This thread was originally posted in the [Java Media Framework|http://forums.sun.com/forum.jspa?forumID=28] forum, but moved to this forum for closer topic alignment.

  • File permissions in Java

    Hi all,
    I'm converting a python script to Java.
    The script creates a directory with special file permissions, as seen below:
    os.makedirs(options.file, 0777)
    ..Is there an equivalent way to set file permissions in Java (and would I need to bother what that..)?
    /Best regards, H�kan Jacobsson - System developer in Sweden

    Is there an equivalent way to set file permissions in JavaNot really. The File class allows you to set some permissions, but I don't think it lets you set the execute bit.
    and would I need to bother what thatDepends entirely on why the original python programmer selected those options.

  • Cannot Acccess Applet Object from Java Script

    Hi,
    I am using jRE1.5, and Kava Chart Applets. Those applet jars are compiled in jdk 1.5 version. I have created one jsp where I used ,<applet> tag. The problem is when ever I am going to access the applet object from java script it is not returning the actual java applet object, when put an alert message it shows [object]. So i am not able to access the methods or the applet class.and also the screen gets hung, nothing is coming.It get stuck at the point where i tried to access the applet method like document.getElementById(applet_id).<<<some method of the applet class>>.Also it is not showing any kind of javascript error or Applet class exceptions.
    But the strange thing is, when i use jdk 1.6, the page is running fine.Also when i try to print the applet object from javascript it is showing the proper class name.
    Please help me solving the problem.

    A number of changes and improvements were made between 1.5 and 1.6 - the entire plugin is new. You need to change to 1.6, as 1.5 goes EOL about November this year and future changes to this area in 1.5 are unlikely.

  • News server not found!! news:comp.lang.java.programmer HELP

    I trying to join newsgroup comp.lang.java.programmer
    but keep getting news server not found.
    Please help.

    No it's the name of the news group. You may add news1.sinica.edu.tw as the news server and select the group from those listed.

  • Java applet permissions (allow access to ports 1024 )

    Hello everyone,
    Not sure if this is the place to post this question but this forum has been extremely helpful to me in the past.
    I'm interested in allowing a java applet to both edit my hosts file and bind to privileged ports (this is for a trusted corporate SSL VPN connection). I've tried editting my java.policy file, but it doesn't seem to affect anything. Even if I set a policy rule to temporarly allow ALL java applets to use privileged ports, it still won't work. Ditto for allowing write file permissions to /etc/hosts:
    grant {
      permission java.io.FilePermission "/etc/hosts", "write";
    The only thing that seems to work is running firefox in root, which I really don't want to do.
    Am I going about this the right way? Thanks!

    If applet is signed, Change in Java Control Panel tab Security, Security Level to High.

  • Applet fails after Java 6 update 41 to java 6 update 60

    hi,
    Currently updated Java 6 update 41 to java 6 update60,and my applet is failing and throwing the following exception
    org.apache.commons.httpclient.HttpRecoverableException: Maximum redirects (100) exceeded
        at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1105)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:643)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
        at com.cisco.unity.mediamaster.httpclient.utility.UploadByteArrayCache.sendRequest(UploadByteArrayCache.java:341)
        at com.cisco.unity.mediamaster.httpclient.utility.UploadByteArrayCache.sendMultipartPostRequest(UploadByteArrayCache.java:286)
        at com.cisco.unity.mediamaster.ums.thread.UploadMPThread.uploadStream(UploadMPThread.java:530)
        at com.cisco.unity.mediamaster.ums.thread.UploadMPThread.uploadParts(UploadMPThread.java:461)
        at com.cisco.unity.mediamaster.ums.thread.UploadMPThread.run(UploadMPThread.java:392)
        at java.lang.Thread.run(Unknown Source)
    Can anyone help here? is there known bug for this.

    Thanks for the reply..
    I used your tool and it seems my jnlp file is ok ..(nothing in red)
    I have actually identified the problem and it seems after update to java 6 update 14.. I am not able to access any resources
    Here the function that reads a .csv file
    private int readStateMapData(String theAbName) {
    .............................//lines deleted
    lineBuf = "stateCodes.csv";
    dPanel.showStatus("Reading state code information...", null);
    lineBuf = "map-data/" + lineBuf;
    try {
    URL url = new URL(getCodeBase(), lineBuf);
    BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
    stateID = null;
    while ((lineBuf = in.readLine()) != null) {
    StringTokenizer st = new StringTokenizer(lineBuf);
    String ID = st.nextToken();
    String name = st.nextToken();
    if (name.equals(theAbName)) { stateID = ID; break; }
    in.close();
    if (stateID == null) return STATE_NOT_FOUND;
    } catch (MalformedURLException me) { return BAD_STATECODE_FILE; }
    catch (IOException ie) { return BAD_STATECODE_FILE; }
    I already have a logic built into my program that displays and error message and it shows "cannot read state code file"
    These files are inside my jar. Again if I uninstall java 6 update 14 webstart works fine ..What should I do ??
    Here is my jnlp file :
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="file:/G:/WNV_proj/dist/" href="launch.jnlp">
    <information>
    <title>XXXXXXXXXXX</title>
    <vendor>XXXXXXXXX</vendor>
    <description>MICRO-MAPS</description>
    <description kind="short">MICRO-MAPS</description>
    <offline-allowed/>
    </information>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-Djava.security.policy=applet.policy"/>
    <jar href="MICRO-MAPS.jar" main="true" download="lazy"/>
    </resources>
    <applet-desc main-class="Micromaps" name="Micromaps" width="940" height="640">
    </applet-desc>
    </jnlp>
    Edited by: atjava on Jul 15, 2009 12:26 PM

Maybe you are looking for

  • ITC-60 TV Out cable support for Aino

    Aino has been a great multimedia phone. However it is a pity that SE has not enabled the TV out feature for this phone, despite its sibling C905 is TV-out-enabled Is there any plan for SE on this?

  • Bug average calculation in form?

    Hye, I made an editable form in acrobat XI for mac. I set all the fields to number and the last field I want to calculate the average of all the other fields. So I select the fields which average I want... But upon testing, I'm getting impossible ave

  • JTable and MultiLineCellRenderer

    I got a code of MultiLineCellRenderer from the net and its kinda a template and I've been working on it. My problem is how to set the size of the Renderer properly and automatically so that the text fits in it. import java.awt.Component; import javax

  • Screen too narrow

    The screen of my MacBook Pro is suddenly too narrow. There are 2 black bars on either side of the screen and the actual picture you should see is compressed in the middle. I tried to change the monitor/screen settings but it didn't help. some program

  • Using SE as a Controller

    Hello, Is it possible to use SignalExpress to automate the repitition of the following task... 1) Record a voltage for 30 seconds using an NI DAQ 2) Send a digital output immediately following the 30 seconds to open/close an air valve for the next 5