Runtime in sign applet (IE)

i wrote a sign applet calling an execution file (aaa.exe).
Is it possible to do that combining this applet( x.class )
and the execution file into a cab file(for building a sign applet)
and still work when I use Runtime.exec("aaa.exe").
If it is NOT possible to do so,
is there any other way to do this?

See it depends on ur requirements.Let me know wheather u want to run the applet in Browse or as an application through appletviewer.
If case is first,then it is not possible.Applet can not read or do any operation with local system or where it is runing.Java provide a high level of security.How can you read ,write or execute any file through applet which is running in Browser.Then it will be easy to write a applet to crash your system files is n't it!! and more or less this applet will act as virus which can play with your system.Java does allow this.
Let me know ur exact requirements.

Similar Messages

  • Problem on runtime enviorment for signed applet

    I am using the Java Media Framework for video capturing .Problem which i am facing is i have to configure the client machine so i wanted to download few of the class files which will execute on the client side and then stream the video back to the server .For this i have dezigned a java applet.This applet is signed by myself without any external agency so when ever the application is executed where it was signed this application gives no problem but when a different machine access the applet the user is asked for the verification of the applet but the error is thrown stating that the class not found exception .So please guide me that while making a signed applet which all packages need to be signed and what is the procedure .Do i have to sign the jmf packages also .

    I have signed applets but not with jmf. Your best bet is to put the applet in a jar and sign the jar. Most java runtimes with a self signed applet will prompt the user and ask the user if they want to grant permission. You probably have to use the java html converter to code your html to force the use of suns plugin. I am not sure if you have to sign the jmf jars or they may already be signed.

  • Signed applet don't work on XP

    Hi,
    I'am currently working on a point-of-sale (POS) using windows XP/Firefox and a linux apache/jboss server.
    I have developed a dynamic windows library in order to use an industrial printer connected to the POS to perform some printing without confirmation of the customer.
    The POS is under Windows XP SP2 and use Firefox 2.0.0.11/JRE 1.5.0.14.
    This dll is used by a signed applet located on the apache/jboss server.
    The applet is correctly downloaded by the client, but normally i have to wait for the certicat authentification windows appearing and for confirming that i want execute the applet. And instead i have a java exception :
    security: La v�rification du certificat � l'aide des certificats AC racine a �chou�
    security: Aucune information d'horodatage disponible
    java.lang.NullPointerException
         at com.sun.deploy.ui.UIFactory.showSecurityDialog(Unknown Source)
         at com.sun.deploy.security.TrustDeciderDialog.showDialog(Unknown Source)
         at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
         at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
         at sun.plugin.security.PluginClassLoader.getPermissions(Unknown Source)
         at java.security.SecureClassLoader.getProtectionDomain(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.access$100(Unknown Source)
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    security: L'utilisateur a refus� les droits d'acc�s au code
    basic: Taille de cache du chargeur de classes courant : 1
    basic: Termin�...
    basic: Jonction du thread d'applet...
    basic: Destruction de l'applet...
    basic: Elimination de l'applet...
    basic: Sortie de l'applet...
    java.lang.ExceptionInInitializerError
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         at java.lang.reflect.Constructor.newInstance(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.C:\Program Files\BICImpression\impression_api.dll)
         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.checkLink(Unknown Source)
         at java.lang.Runtime.load0(Unknown Source)
         at java.lang.System.load(Unknown Source)
         at applets.impression.Impression.<clinit>(Impression.java:38)
         ... 11 moreand then the certicat authentification windows appears but it's too late, the applet won't never execute ...
    the apache/jboss server is accessed via some gateway, firewal, ... tha t i can't control
    the apache jboss/server on my own PC is accessed directly :
    What is amazing, is that work fine with my own professionnal PC on W2000 SP4, with JRE1.5.0.14 and Firefox 2.0.0.11 :
    when I look in the java console, the java freeze until i have answered this java security window (certicat authentification windows). And when i answered "run" no problem the applet makes her own job.
    here is the code when it works :
    security: La v�rification du certificat � l'aide des certificats AC racine a �chou�
    security: Aucune information d'horodatage disponible
    basic: Plugin modality.pushed
    basic: Modalit� empil�e
    basic: push javax.swing.JDialog[dialog0,379,296,519x323,layout=java.awt.BorderLayout,modal,title=Avertissement - S�curit�,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,3,22,513x298,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777673,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]
    basic: Chargement arr�t�...
    basic: Arr�t de l'applet...Conclusion
    POS : Win XP SP2, JRE1.5.0.14 (i tried 1.5.0.6 and 1.6.3 the latest), Firefox 2.0.0.11 (I tried 2.0.0.0 and 3 beta2 don't work anyway)
    my own server/client : W2000 SP4, JRE1.5.0.14, Firefox 2.0.0.11
    Linux server : RHEL4
    It works with IE on the POS with the linux sever but it's not the selected browser.
    It works with IE on the POS with my own server.
    It works with Firefox on the POS with my own server.
    It works with IE on my own server with the linux sever but it's not the selected browser.
    It works with IE on my own server with my own server.
    It works with Firefox on my own server with the linux sever.
    It works with Firefox on my own server with my own server.
    If you have some idea to make it work i'm you're buyer !!
    Thank a lot for reading this, and i apologize for my poor english ...
    greetings,
    Benoit
    Edited by: bendur on Feb 29, 2008 3:49 AM

    Ok I have found my problem :
    On every web pages, we have defined some inactivity timeouts.
    On my own server I have disabled these timeouts but not on the distant timeout.
    And it seems that the timeout (defined in javascript ont he web pages : 3s) has a very bad influence on the launching of my applet ... only with firefox (with IE and Opera no problem)
    My problem is anwsered but the problem keep alive for firefox ...

  • Please HELP !!! Signed Applet & Java Media Framework(JMF)

    Hi,
    I have written a self signed applet that is used for Recording voice running in browser:
    The tag that I've given is as follows:
    <OBJECT
    classid = "clsid:CAFEEFAC-0014-0001-0000-ABCDEFFEDCBA"
    id="recordApplet"
    codebase = "http://java.sun.com/products/plugin/autodl/jinstall-1_4_1-windows-i586.cab#Version=1,4,1,0"
    WIDTH = 268 HEIGHT = 27>
    <PARAM NAME = CODE VALUE = "RecWindow">
    <PARAM NAME = ARCHIVE VALUE = "jmf.jar,sound.jar,SignedRecWindow.jar">
    <PARAM NAME = "soundtrack" VALUE="testFile.mp3">
    <PARAM NAME = "type" VALUE = "application/x-java-applet;jpi-version=1.4.1">
    <PARAM NAME = "scriptable" VALUE = "true">
    <PARAM NAME = "MAYSCRIPT" VALUE = "true">
    </OBJECT>
    I've also signed jmf.jar as well as sound.jar that come in JMF 2.1 and am including it the archive. These jars are downloaded on client machine.
    My code works perfectly BUT only when JMF 2.1 is installed on the clients machine else I get a RunTime Exception stating "no permission to capture from applet".
    JMF FAQ states that If a user chooses to allow playing back locally stored media files or saving media files locally, he/she can do so by making use of a policy file. http://java.sun.com/products/java-media/jmf/2.1.1/faq-jmf.html#jmf2-applet-run
    My requirement is that once the user has agreed to the signed applet to run then there should be no need to install JMF rather use the jmf.jar that is downloaded on client machine.
    Also how can I grant the permission (permission javax.sound.sampled.AudioPermission "record";) to my applet in client computers ?
    The client should not be asked to add any files (policy) by itself, all must be transparent for him.
    Thanks in advance.
    Vipin.

    I too have been trying to get Java JMF sound recording to work via webstart. No luck so far.
    I even tried playing (security.AllPermissions) with .java.policy file in the user's home directory and even modifying java.policy in the JRE/lib/security directory. No luck there too!
    I also added security.AllPermissions to the javaws.policy in the JRE/jawas/javaws.policy file. Still no luck!
    Any idea, anyone?

  • Access denied to a security provider on a signed applet

    Hi,
    I'm having permissions problems to work with a security provider.
    The security provider is already installed at java.security. In fact, at Netbeans when debbuging the app it's working perfectly.
    If I'm working the provider in an signed applet, then there are errors.
    Even, I have created a .jar file and I have saved in the /ext directory, wich by default in the java.policy file has got all security permissions.
    grant codeBase "file:${{java.ext.dirs}}/*" {
    permission java.security.AllPermission;
    Even with these granted permissions, I'm getting problems to work with the security provider that I have installed. Also, with these permissions I should be able to install the security provider.
    log:
    <record>
    <date>2012-03-13T12:13:39</date>
    <millis>1331637219126</millis>
    <sequence>17</sequence>
    <logger>appletpdf.appletPdf</logger>
    <level>SEVERE</level>
    <class>appletpdf.appletPdf</class>
    <method>applTest</method>
    <thread>11</thread>
    <message>excepcion: {0} </message>
    <exception>
    <message>java.security.AccessControlException: access denied (java.security.SecurityPermission authProvider.SunPKCS11-Provider-name)</message>
    <frame>
    <class>java.security.AccessControlContext</class>
    <method>checkPermission</method>
    <line>393</line>
    </frame>
    <frame>
    <class>java.security.AccessController</class>
    <method>checkPermission</method>
    <line>553</line>
    </frame>
    <frame>
    <class>java.lang.SecurityManager</class>
    <method>checkPermission</method>
    <line>549</line>
    </frame>
    <frame>
    <class>net.sourceforge.jnlp.runtime.JNLPSecurityManager</class>
    <method>checkPermission</method>
    <line>250</line>
    </frame>
    <frame>
    <class>sun.security.pkcs11.SunPKCS11</class>
    <method>login</method>
    <line>1036</line>
    </frame>
    <frame>
    <class>sun.security.pkcs11.P11KeyStore</class>
    <method>login</method>
    <line>874</line>
    </frame>
    <frame>
    <class>sun.security.pkcs11.P11KeyStore</class>
    <method>engineLoad</method>
    <line>764</line>
    </frame>
    <frame>
    <class>java.security.KeyStore</class>
    <method>load</method>
    <line>1201</line>
    </frame>
    <frame>
    <class>apppdf.appPdf</class>
    <method>tPKCS11</method>
    <line>174</line>
    </frame>
    <frame>
    <class>appletpdf.appletPdf</class>
    <method>applTest</method>
    <line>137</line>
    </frame>
    <frame>
    <class>appletpdf.appletPdf</class>
    <method>initapplDPdf</method>
    <line>116</line>
    </frame>
    <frame>
    <class>sun.reflect.NativeMethodAccessorImpl</class>
    <method>invoke0</method>
    </frame>
    <frame>
    <class>sun.reflect.NativeMethodAccessorImpl</class>
    <method>invoke</method>
    <line>57</line>
    </frame>
    <frame>
    <class>sun.reflect.DelegatingMethodAccessorImpl</class>
    <method>invoke</method>
    <line>43</line>
    </frame>
    <frame>
    <class>java.lang.reflect.Method</class>
    <method>invoke</method>
    <line>616</line>
    </frame>
    <frame>
    <class>sun.applet.PluginAppletSecurityContext$4</class>
    <method>run</method>
    <line>699</line>
    </frame>
    <frame>
    <class>java.security.AccessController</class>
    <method>doPrivileged</method>
    </frame>
    <frame>
    <class>sun.applet.PluginAppletSecurityContext</class>
    <method>handleMessage</method>
    <line>696</line>
    </frame>
    <frame>
    <class>sun.applet.AppletSecurityContextManager</class>
    <method>handleMessage</method>
    <line>69</line>
    </frame>
    <frame>
    <class>sun.applet.PluginStreamHandler</class>
    <method>handleMessage</method>
    <line>273</line>
    </frame>
    <frame>
    <class>sun.applet.PluginMessageHandlerWorker</class>
    <method>run</method>
    <line>82</line>
    </frame>
    </exception>
    </record>
    Fails in the line where the KeyStore is loading:(Pin is correct)
    KeyStore myKeyStore=null;
    Provider p = Security.getProvider("SunPKCS11-Provider-Name");
    myKeyStore = KeyStore.getInstance("PKCS11",p);
    char[] pinData = pin.toCharArray();
    myKeyStore.load(null, pinData);
    Any help would be apreciated.
    Thank you.
    Bye

    Thank you for your information, Frank, as it clarifies part of my confusion. However, there are a couple more loose ends I'd love to address before I mark your responses as answers.
    Do backup and restore privileges apply at all over a network mount created via "net use"?
    The network mount requires a username and password for the destination machine. Assuming the destination machine is a Windows box with a simple CIFS share, how does this user affect our permissions and access? Do we end up effectively impersonating this
    user, or is the access check still done with our sync process's run-as user?
    We require that both our configured run-as user for our sync process *and* the credentials passed to the network mount be administrator users of the local system and destination system, respectively, meaning they're in of the "BUILTIN\Administrators,
    S-1-5-32-544" group.
    On re-syncs, the destination file will exist and since we don't have the ability to read the ACL in all cases (we're running as one user, the file is owned by another user, and we aren't specified in the ACL in any way), we aren't able to determine if the
    file has changed. Is it possible to determine the owner of this file in this case? Preferably, we'd obtain the entire SDDL.
    My proposed plan is to interpret access denied as a difference requiring re-sync, resulting in us taking ownership of the file, granting ourselves access, determining if there are data differences, and then re-syncing the metadata as appropriate.

  • Signed applet stopped working in 1.4.2_04

    We have a signed applet that accesses the file system. After installing 1.4.2_04 it produces this exception
    java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
         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.checkExec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at edu.nebraska.foundation.applets.AccessApplet.openNewSession(AccessApplet.java:35)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    java.lang.Exception: java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    .This was working in 1.4.2 and 1.3.1_08. Anyone else have this problem?

    Sorry, copied and pasted the following, hope it helpes.
    The following examples are for a win 2000 machine, for linux
    you have to use alternative paths but I think the commands
    are about the same.
    The SUN jre doesn't care about IE settings, if an applet is signed it will ask the user "do you trust", if
    the user chooses yes or always the applet can do pretty much anything.
    Because anybody can sign an applet so it will pop up the do
    you trust dialog I prevent this dialog from popping up by
    adding the following to the
    C:\Program Files\Java\j2re****\lib\security\java.policy
    under grant { [/b]
    [color red]
    permission java.lang.RuntimePermission "usePolicy";
    [color]
    You now need to set up special permissions for sites that
    need it, signed applets get no special treatment since you
    specified in the java.policy that policy should allways be
    used.
    When your applet needs to do something it normally could
    not do (applet security) [b]and it needs to do this
    when a user clicks on a html button (applet method called
    from javascript), than all the signing and policy settings
    in the world wouldn't work Unless you grant all permission
    to all code.
    This is because the Java Plug-in executes methods with
    applet sandbox security restrictions.
    http://archives.java.sun.com/cgi-bin/wa?A2=ind0404&L=java-security&F=&S=&P=4012
    To solve this you can start a new thread that checks ...
    times a second if a variable meets certain conditions.
    These conditions are changed with public methods called
    from JavaScript. When a variable meets certain Conditions
    this thread will start the method that will perform
    normally restricted tasks.
    Here is an example where the applet doesn't work
    (the batchfile, html file are OK)
    Note that running this code with Mozilla on my w2k machine
    crashes Mozilla (not on my Fedora machine)
    Batch file to sign the applet: (please note this will
    delete some files)
    del *.cer
    del *.com
    del *.jar
    del *.class
    javac -classpath ".;C:\Program Files\Java\j2re1.4.2_04\lib\plugin.jar" test.java
    keytool -genkey -keystore harm.com -keyalg rsa -dname "CN=Harm Meijer, OU=Technology, O=org, L=Amsterdam, ST=, C=NL" -alias harm -validity 3600 -keypass pass -storepass pass
    jar cf0 test.jar test.class
    jarsigner -keystore harm.com -storepass pass -keypass pass -signedjar sTest.jar test.jar harm
    del *.classThe html page:
    <DIV id="dvObjectHolder">  </DIV>
    <br><br>
    <script>
    if(window.navigator.appName.toLowerCase().indexOf("netscape")!=-1){ // set object for Netscape:
         document.getElementById('dvObjectHolder').innerHTML = "        <object ID='appletTest1' classid=\"java:test.class\"" +
                    "height=\"0\" width=\"0\" onError=\"changeObject();\"" +
              ">" +
                    "<param name=\"mayscript\" value=\"Y\">" +
                    "<param name=\"archive\" value=\"sTest.jar\">" +
            "</object>";
    }else if(window.navigator.appName.toLowerCase().indexOf('internet explorer')!=-1){ //set object for IE
         document.getElementById('dvObjectHolder').innerHTML =      "<object ID='appletTest1' classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\"" +
                   "         height=\"0\" width=\"0\" >" +
                   "   <param name=\"code\" value=\"test.class\" />" +
                      "<param name=\"archive\" value=\"sTest.jar\">" +
                   " </object>"
    </script>
    <LABEL id="lblOutputText">This text will be replaced by the applet</LABEL>
    <BR>
    <input value="Javascript to java" type=button onClick="document.appletTest1.fromJavaScript()"><br>The applet:
    // new class for jsObject!!!! since 1.4.2 compile this:
    // javac -classpath "C:\Program Files\Java\j2re1.4.2_01\lib\plugin.jar" test.java
    // since jaws.jar does not exsist anymore
    // to compile with jaws: javac -classpath "C:\j2sdk1.4.0_03\jre\lib\jaws.jar" test.java
    import netscape.javascript.*;
    public class test extends java.applet.Applet {
        JSObject win;
        JSObject outputLabel;
        public void init() {
             try{
                 win = JSObject.getWindow(this);
                 outputLabel = (JSObject) win.eval("document.getElementById('lblOutputText')");
              outputLabel.setMember("innerHTML", "<center><h1>From Init<br>Your homedir " + System.getProperty("user.home") + "</h1></center>");
            }catch(Exception e){
                 e.printStackTrace();
        public void fromJavaScript(){
             try{
                     outputLabel.setMember("innerHTML", "<center><h1>From javascript<br>Your homedir: "+ System.getProperty("user.home") + "</h1></center>");
            }catch(Exception e){
                 e.printStackTrace();
    }When you put the files in c:\temp, run the batch file to
    compile and sign the applet and then open the html file you
    will be asked if you trust ... you can say yes and from
    init the applet can read user.home. Click on the button and
    you will get the following stack trace:
    java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)
         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.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at test.fromJavaScript(test.java:20)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)Conclusion: the applet can read user.home but not from
    JavaScript.
    Here is the applet that does work because a method called
    from javaScript doesn't perform a restricted task.
    // new class for jsObject!!!! since 1.4.2 compile this:
    // javac -classpath "C:\Program Files\Java\j2re1.4.2_01\lib\plugin.jar" test.java
    // since jaws.jar does not exsist anymore
    // to compile with jaws: javac -classpath "C:\j2sdk1.4.0_03\jre\lib\jaws.jar" test.java
    import netscape.javascript.*;
    public class test extends java.applet.Applet {
         JSObject win;
         JSObject outputLabel;
         boolean buttonFromJavaClicked = false;
         checkJavaScriptEvent evt = new checkJavaScriptEvent();
         public void init() {
              try {
                   evt.start();
                   win = JSObject.getWindow(this);
                   outputLabel =
                        (JSObject) win.eval("document.getElementById('lblOutputText')");
                   outputLabel.setMember(
                        "innerHTML",
                        "<center><h1>From Init<br>Your homedir "
                             + System.getProperty("user.home")
                             + "</h1></center>");
              } catch (Exception e) {
                   e.printStackTrace();
         public void fromJavaScript() {
              buttonFromJavaClicked = true;
         private void fromJavaScript2() {
              System.out.println("fromjavascript2 is started");
              try {
                   String strLbl =
                        "<center><h1>From javascript<br>Your homedir: "
                             + System.getProperty("user.home")
                             + "</h1></center>";
                   outputLabel.setMember("innerHTML", strLbl);
              } catch (Exception e) {
                   e.printStackTrace();
         class checkJavaScriptEvent extends Thread {
              public void run() {
                   while (true) {
                        if (test.this.buttonFromJavaClicked) {
                             System.out.println("OK buttonfromjava is true");
                             test.this.buttonFromJavaClicked = false;
                             test.this.fromJavaScript2();
                        try {
                             Thread.sleep(300);
                        } catch (Exception e) {
                             System.out.println("exception in sleep");
                             e.printStackTrace();
                             System.exit(1);
    }

  • Signed applet stopped working with 1.4.2_04

    We have a signed applet that accesses the file system. After installing 1.4.2_04 it produces this exception
    java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
         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.checkExec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at edu.nebraska.foundation.applets.AccessApplet.openNewSession(AccessApplet.java:35)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    java.lang.Exception: java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$2.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)This was working in 1.4.2 and 1.3.1_08. Anyone else have this problem?

    When you run this signed applet, turn on the Java console and tracing, you can type 5 in Java console during start up, what is the tracing statements, especial for the security.
    If the jar file has been signed and you see a security dialog box, then you should be able to give all permission to it to run.
    If no security dialog box popup, then JRE think the certificate is bad. no permission will give anyway.

  • AccessControlException - in signed applet

    hi all,
    I am using signed applet, i given all permission and all socket permission , still i am getting following error.
    java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.0.222:6060 connect,resolve)
         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.checkConnect(Unknown Source)
         at java.net.DatagramSocket.send(Unknown Source)
         at gov.nist.javax.sip.stack.UDPMessageChannel.sendMessage(UDPMessageChannel.java:727)
         at gov.nist.javax.sip.stack.UDPMessageChannel.sendMessage(UDPMessageChannel.java:572)
         at gov.nist.javax.sip.stack.SIPClientTransaction.sendMessage(SIPClientTransaction.java:355)
         at gov.nist.javax.sip.stack.SIPClientTransaction.sendRequest(SIPClientTransaction.java:759)
         at gov.nist.applet.phone.ua.MessengerManager.deRegister(MessengerManager.java:565)
         at gov.nist.applet.phone.ua.MessengerManager.unRegisterAndReRegister(MessengerManager.java:523)
         at gov.nist.applet.phone.ua.gui.NISTMessengerApplet.jMenuItemRegisterActionPerformed(NISTMessengerApplet.java:517)
         at gov.nist.applet.phone.ua.gui.NISTMessengerApplet.access$7(NISTMessengerApplet.java:503)
         at gov.nist.applet.phone.ua.gui.NISTMessengerApplet$5.actionPerformed(NISTMessengerApplet.java:424)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-2" 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 java.lang.Runtime.exit(Unknown Source)
         at java.lang.System.exit(Unknown Source)
         at gov.nist.core.InternalErrorHandler.handleException(InternalErrorHandler.java:27)
         at gov.nist.javax.sip.stack.UDPMessageChannel.sendMessage(UDPMessageChannel.java:733)
         at gov.nist.javax.sip.stack.UDPMessageChannel.sendMessage(UDPMessageChannel.java:572)
         at gov.nist.javax.sip.stack.SIPClientTransaction.sendMessage(SIPClientTransaction.java:355)
         at gov.nist.javax.sip.stack.SIPClientTransaction.sendRequest(SIPClientTransaction.java:759)
         at gov.nist.applet.phone.ua.MessengerManager.deRegister(MessengerManager.java:565)
         at gov.nist.applet.phone.ua.MessengerManager.unRegisterAndReRegister(MessengerManager.java:523)
         at gov.nist.applet.phone.ua.gui.NISTMessengerApplet.jMenuItemRegisterActionPerformed(NISTMessengerApplet.java:517)
         at gov.nist.applet.phone.ua.gui.NISTMessengerApplet.access$7(NISTMessengerApplet.java:503)
         at gov.nist.applet.phone.ua.gui.NISTMessengerApplet$5.actionPerformed(NISTMessengerApplet.java:424)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.AbstractButton.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

    Do you trust java exception handling mechanism ??? If so, check all yours given permission one more time, try to find work examples how to do it.
    Try to find the solution here: http://java.sun.com/developer/technicalArticles/Security/applets/index.html

  • Signed applet crashes

    Hello all!
    Has ever happened to someone that when using a signed applet, the browser crashes without giving an error or something?
    I made an applet that had to read a file on the server, then signed it, and when trying it, after the browser asked me if to trust the signature, all freezed and nothing else happened...
    I am developing an applet with NetBeans, the code in question is this:
    import java.io.*;*
    *import java.util.*;
    public class PhotoAlbum extends javax.swing.JApplet {
        /** Initializes the applet PhotoAlbum */
        public void init()
            try
                java.awt.EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                        initComponents();
            } catch (Exception ex)
                ex.printStackTrace();
        public void start()
            try
                initAlbum();
            catch (Exception e)
                error.setText(e.getLocalizedMessage()); //"error" is a textbox. I use that to write the exceptions caught runtime.
        private void initAlbum() throws Exception
          FileReader reader = new FileReader("/Foto/PhotoDB");
    @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            modLista = new javax.swing.DefaultListModel();
            jScrollPane1 = new javax.swing.JScrollPane();
            listaAlbum = new javax.swing.JList();
            jScrollPane2 = new javax.swing.JScrollPane();
            error = new javax.swing.JTextArea();
            jLabel1 = new javax.swing.JLabel();
            listaAlbum.setModel(modLista);
            listaAlbum.setVisibleRowCount(4);
            jScrollPane1.setViewportView(listaAlbum);
            error.setColumns(20);
            error.setRows(5);
            jScrollPane2.setViewportView(error);
            jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Foto/bell_urlo.png"))); // NOI18N
            jLabel1.setText("jLabel1");
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 547, Short.MAX_VALUE)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 523, Short.MAX_VALUE)
                    .addContainerGap())
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap(117, Short.MAX_VALUE)
                    .addComponent(jLabel1)
                    .addGap(72, 72, 72))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel1)
                    .addGap(12, 12, 12)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        }// </editor-fold>
        // Variables declaration - do not modify
        private javax.swing.JTextArea error;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JScrollPane jScrollPane2;
        private javax.swing.JList listaAlbum;
        private javax.swing.DefaultListModel modLista;
        // End of variables declaration
        public Album[] collection;
        public Album current;
        public int photoIndex;
    }This is the basic code, I deleted all the instructions, leaving the one from where the error started (the filereader declaration)
    I don't have any idea on why the browser crashes...
    When the applet is unsigned, on the textbox is shown correctly the error "permission denied".
    On other files the signing procedure goes ok, since I tried it on a program I found on the internet @ http://www.captain.at/programming/java/
    Edited by: DrZoidberg on Sep 15, 2008 9:15 AM

    are you using IE?
    i use mozilla and this is what i see when i trust the certificate.
    java.lang.SecurityException: class "PhotoAlbum$1"'s signer information does not match signer information of other classes in the same package
    at java.lang.ClassLoader.checkCerts(Unknown Source)
    at java.lang.ClassLoader.preDefineClass(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at PhotoAlbum.init(PhotoAlbum.java:21)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
    at PhotoAlbum.start(PhotoAlbum.java:40)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    might help you :)

  • Having trouble with my signed applet(if it's properly signed that is)

    hi
    I'm having trouble with my supposedly signed applet. I'm trying to execute a specific program in this case trilian from my browser. i'm using firefox
    first my java code
    package applet;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class RunApplet extends JApplet {
        JButton jButton = new JButton();
        FlowLayout flowLayout1 = new FlowLayout();
        public RunApplet() {
            try {
                init();
            } catch (Exception ex) {
                ex.printStackTrace();
        private void init() throws Exception {
            try {
                this.getContentPane().setLayout(flowLayout1);
                this.setSize(new Dimension(100, 200));
                jButton.setText("Trillian");
                jButton.addActionListener(new RunApplet_jButton_actionAdapter(this,
                        "\"C:\\Program Files\\Trillian\\trillian.exe\""));
                this.getContentPane().add(jButton, null);
            } catch (Exception e) {
                e.printStackTrace();
    class RunApplet_jButton_actionAdapter implements ActionListener {
        private RunApplet adaptee;
        private String programPath;
        RunApplet_jButton_actionAdapter(RunApplet adaptee, String programPath) {
            this.adaptee = adaptee;
            this.programPath = programPath;
        public void actionPerformed(ActionEvent e) {
            try {
                Runtime.getRuntime().exec(this.programPath);
            } catch (IOException ex) {
    }And my applet code
    <html>
    <body>
    <!--"CONVERTED_APPLET"-->
    <!-- HTML CONVERTER -->
    <object
        classid = "clsid:CAFEEFAC-0015-0000-0005-ABCDEFFEDCBA"
        codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5_0_05-windows-i586.cab#Version=5,0,50,5"
        >
        <PARAM NAME = CODE VALUE = "applet.RunApplet.class" >
        <PARAM NAME = ARCHIVE VALUE = "myfile.jar" >
        <param name = "type" value = "application/x-java-applet;jpi-version=1.5.0_05">
        <param name = "scriptable" value = "false">
        <comment>
         <embed
                type = "application/x-java-applet;jpi-version=1.5.0_05" \
                CODE = "applet.RunApplet.class" \
                ARCHIVE = "myfile.jar"
             scriptable = false
             pluginspage = "http://java.sun.com/products/plugin/index.html#download">
             <noembed>
                </noembed>
         </embed>
        </comment>
    </object>
    <!--
    <applet CODE = "applet.RunApplet.class" ARCHIVE = "myfile.jar">
    </applet>
    -->
    <!--"END_CONVERTED_APPLET"-->
    </body>
    </html>Creating my key:
    keytool -genkey -alias sitekey -keystore "C:\Program Files\Java\jdk1.5.0_05\jre\lib\security\cacerts"Now the process of creating the jar file and signing it:
    1. jar cf myfile.jar *.class
    2. jarsigner -keystore "C:\Program Files\Java\
    jdk1.5.0_05\jre\lib\security\cacerts" myfile.jar sitekeyNow this is the way i've been using then and the first time i get the "do you want to trust" screen but still i get a security exception.
    Exception in thread "AWT-EventQueue-10" java.security.AccessControlException: access denied (java.io.FilePermission <<ALL FILES>> execute)
         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.checkExec(Unknown Source)
         at java.lang.ProcessBuilder.start(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at applet.RunApplet_jButton_actionAdapter.actionPerformed(RunApplet.java:73)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)Is there anybody who have an idea what can be wrong?
    regards
    thallish

    ok i solved i myself. i assigned a different and thereby correct keystore and now it works like it should
    regards
    thallish

  • Is it necessary to have java installed on each system to run sign applet?

    I have successfully signed an applet, and I am using it from my website. I havesigned the applet digitally. But the problem is that it's run successfully on the system in which java is installed but it do not not run on the system on which java is not installed. There is warning java plug-ins missing. I have tried to run many banking website which is using signed applet from Trusted parties they run successfully. I have searched many tutorials and forums but not able to find any help.
    Thanks in advance.

    jsrpanky wrote:
    Thanks sabre,
    I think you are right, I know I'm right!
    because I was going through a article and found that it is possible to auto-download the Java Runtime Environment (JRE) onto the users machine.But I don't have any idea of how to auto-download JRE.
    Could you give me some hints so that I could some idea about this.Not really. I just put a link to the Sun site and ask the user to follow the directions. Google is your friend.

  • IE Specific problem loading signed applet java 1.5

    Hello,
    I am having troubles loading our signed applet under IE 6.0 (only tested version atm).
    Firefox loads it without trouble, though the <object> tag that launches each is different.
    Every time I try to launch the applet, it prompts me to install the java runtime environment. I currently have 3 different versions of the java 1.5 runtime on my machine and the Java Control Panel is set to default to the most recent (1.5.04).
    Regardless of whether I choose 'Install' or 'Don't Install' a rectangle with a red X appears in the top left corner of the window. Nothing happens if I choose 'Install'. I did install through that prompt once. I don't know why it keeps asking me.
    I have enabled the console before loading the applet, and there is absolutely NO output there. The applet is not loaded at all. I am not prompted to accept or deny our certificate. I have also tried disabling as much as I could security-wise in IE.
    Any help would be greatly appreciated. I've been searching the net for 2 days and haven't come across anything that fixes this problem. Almost everything I have found has indicated at least some console output at least.
    Here is the javascript code I am using. createVCRTarget is called on a button click. I guess I should also mention that this was working some months ago, but it is possible that it was before I installed Service Pack 2. All of my Windows security updates are installed. Also, you should be able to see in here that I also tried using an applet tag. That didn't work either. Nothing loaded when I tried that, the little Active-X icon was in the top left instead of a Red X. That was my first attempt with an applet tag ever though, so it may not have been correct. I think it is obsolete anyways?
    function createVCRTarget() {
         createWindow('valid.package.path.VCRLauncher', 'vcr.jar, targetsdk.jar, xercesImpl.jar, cidero-common.jar', 'VCRTarget', '300', '110');
         return true;     
    function createWindow(classid, jars, title, width, height) {
      var agent = navigator.userAgent.toLowerCase();
      var newWin = window.open("", title, "width="+width+",height="+height+",scrollbar=no,status=no,statusbar=no,resizable=no");
      newWin.document.write("<html>\n");
      newWin.document.write(" <head><title>" + title + "</title>\n");
      newWin.document.write(" <style type=\"text/css\">body { margin: 0; padding: 0; }</style>\n");
      newWin.document.write(" </head>\n<body>\n");
         if (agent.indexOf("msie")==-1) { // not IE
        newWin.document.write('<object classid="java:'+classid+'"');
        newWin.document.write('          codetype="application/java"');
        newWin.document.write('          archive="'+jars+'"');
        newWin.document.write('          width="'+width+'" height="'+height+'">');
        newWin.document.write('</object>');
         } else {
    //          newWin.document.write('<applet archive="'+jars+'" code="'+classid+'" height="'+height+'" width="'+width+'">');
              newWin.document.write('<object classid="clsid:CAFEEFAC-0014-0001-0005-ABCDEFFEDCBA"');
    //          newWin.document.write('               codebase="http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=5,0,0,0"');
              newWin.document.write('               codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0_02-windows-i586.cab#Version=5,0,0,0"')
              newWin.document.write('               width="'+width+'" height="'+height+'">');
              newWin.document.write('<param name="code" value="'+classid+'" />');
              newWin.document.write('<param name="archive" value="'+jars+'" />');
              newWin.document.write('<param name="type" value="application/x-java-applet;jpi-version=1.5.0" />');
              newWin.document.write('</object>');
      newWin.document.write("</body>\n</html>\n");
    }Thanks in advance,
    -Tim

    I see now that you are forsing IE to use jre version 1.4.1_5 but you provide a codebase
    pointing to the 1.5 jre.
    It doesn't matter though what you use evan if you use the htmlconverter if the jdk
    you'll get wrong values for codebase and/or IE is not able to download the cab
    file.
    The only way I was able to install the jre through clsid and codebase browsing a
    page with IE was to download the cab file with mozilla (if you know the correct url to it).
    And then host the cab file yourselve.

  • What are the default permissions for "self-signed" applets?

    Hello!
    I have a self-signed applet (=signed with a self made certificate) and under most plugin-enviroments java asks the user if it accepts this certificate as trustworth.
    On my linux-box I do not have any problems to write files to the local filesystem after I accepted this self-signed applet.
    However I've often read that users must grant some permissions even for signed applets, so is there a list of permissions that are denied by default?
    Are there differences between java releases starting with 1.2.2?
    Thanks in advance, lg Clemens

    Default settings are like you said, jre asks the user and everything will work.
    Unless.your applet uses classes that are not signed like with calls from javascript to your applet the plugin.jar is used and you'll get an exception when writing to files.
    When writing to files the OS might not allowe the user to write to a certain file or folder.
    Don't know what type of exception will be thrown if the OS doesn't allowe it but it has
    nothing to do with applet permissions.
    To change the default setting you can add the following line in the grant { bit of the
    java.policy
    permission java.lang.RuntimePermission "usePolicy";
    When this line is there all signatures will be ignored and an applet can only do extra
    things (like access to local files) if a policy is set up for this applet.
    To find out what's wrong at your clients site you should ask them to send a full trace
    and check that. I hope you did a .printStacktrace() on the exception in your code so
    you can see if any other classes are involved when the exception is thrown.
    To turn the full trace on (windows) you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    if you cannot start the java console check here:
    C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
    I think for linux this is somewhere in youruserdir/java (hidden directory)
    add or change the following line:
    javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    for 1.5:
    deployment.javapi.jre.1.5.0.args=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
    I think for linux this is somewhere in youruserdir/java (hidden directory)

  • IIS, Javascript, Signed Applet and ASP Blank Page Problem

    Hi,
    I'm having a problem using a Signed Applet in a site that runs in a IIS (Windows Server 2003).
    My aspx web page uses the applet to read my smart card and get information from it.
    This applet uses an auxiliar dll (stored in a second Signed Jar file) in order to read the information from my smart card.
    The way the solution is design:
    1) Aspx page is asked from server
    2) Internet Explorer recieve the page and asks the server for it content (images, applet, javascripts, etc)
    3) After this the JVM runs (console opens)
    4) After the Aspx page render fully a javascript register onload fires and call an applet method
    5) Applet receive the call and run the logic of the method:
         - reads the smart card;
         - calls Javascript function in order to fill aspx fields with information from smart card
         - calls Javascript function the simulates a click in a botton of aspx page (in order to call server side part sending data readed from smart card to server)
    5) The server makes some logic with the information receive and responds to client registering in aspx page a call to another Javascrit function
    6) The client received the asnwer from server and runs the Javascript function registered on step 5)
         This Javascript calls another method from applet and runs the following logic:
         - reads more information from smart card;
         - call javascript function in order to fill more fields of aspx page with the information readed
         - calls Javascript function the simulates a click in a botton of aspx page (in order to call server side part sending data readed from smart card to server)
    7) The server makes some logic and call another pages with no Applets
    8) Client asks for a second page with the same applet and we start with another logic express on steps 1);2);3),4);5) and then 7).
    This is all ok, until sometimes the server stop responding correcly for requests regarding this two pages with the Applet.
    When this happens the server just responds with a blank page.
         - with fiddler I can seer the request for the aspx page (that uses the applet)
         - but server responds with a blank html page
    The JVM doesn't fire.
    The IIS log don't show errors.
    The eventviewer doesn't show errors.
    The problem is solved with an IIS reset or a Application Pool reset.
    After a while the problem returns.
    This problem occours for other user in another machine, the server just stops responding correcly to request regarding pages with applets, the other pages still continue to work.
    If we disable Java Control Panel->Advanced->Java Plug-in->Enable the next-generation Java Plug-in the problem seend to stop, but we can't force all clients to disable this option right?
    Or there is a way to force the Applet to run with this option disabled?
    As anyone experience similar problem?
    Regards,
    OF

    This is all ok, until sometimes the server stop responding correcly for requests regarding this two pages with the Applet.
    When this happens the server just responds with a blank page.
    - with fiddler I can seer the request for the aspx page (that uses the applet)
    - but server responds with a blank html pageWell, if http requests look identical in case of success and failure (pay attention to cookies, etc) then it has to be something on the server side.
    It could be that server gets into this wrong state because of previous requests made by applet but it is hard to tell.
    I am not clear how old/new plugin can make a difference unless your applets run in the legacy mode (i.e. you are actually trying to reuse SAME instance of the applet when
    it is loaded next time).
    I'd start with
    1) carefully comparing good/bad sessions
    2) checking whether server will serve correct response to another client when it serves "bad" page for current client
    3) add debug statements to aspx - it is scripted page, may be some condition is not met and then it returns blank?
    4) record all http requests in one session until you get to "error" state and then use any http server testing tool to "replay" this set of requests.
    You should be able to get server into the same state without use of applet. Then you can try to tweak set of requests to see what makes a difference.

  • A sign Applet unable to load "oracle.jdbc.OracleDriver" class

    hi,
    i am chiranjit , i am now working in a web based ERP. where i am using a signed applet which unable to load "oracle.jdbc.OracleDriver" class but it easily loading "sun.jdbc.odbc.JdbcOdbcDriver", i am also giving my code:
    import java.sql.*;
    import java.math.*;
    import java.io.*;
    import java.awt.*;
    class JdbcTest extends Applet{
    public static void main (String args[]) throws SQLException {
    // Load Oracle driver
    DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
    // Connect to the local database
    Connection conn =
    DriverManager.getConnection
    ("jdbc:oracle:thin:@192.168.16.7:1521:kris",
    "plsql", "oracle");
    // Query the employee names
    Statement stmt = conn.createStatement ();
    ResultSet rset = stmt.executeQuery ("SELECT FIRST_NAME FROM
    AUTHORS");
    // Print the name out
    while (rset.next ())
    System.out.println (rset.getString (1));
    // Close the result set, statement, and the connection
    rset.close();
    stmt.close();
    conn.close();
    }

    Hint: The sun.jdbc.odbc.JdbcOdbcDriver is available in any JRE distribution. The Oracle driver is not.

Maybe you are looking for

  • Need some info on general question

    Hello everybody! This question for those who already works as a Java professional. I just don't have a clear picture of how can you apply java programming language in real working environment, in theory I can imagine, but I need a solid understanding

  • Storing PDF and Word document in oracle database

    any idea, how to store PDF and word document using oracle database. thanks

  • How do I delete a downloading movie?

    Hello, I tried to download a movie onto my ipad using itunes. However, I downloaded the HD movie instead of the SD one, so now i do not have enough storage space avaliable to actually download it. How do i delete the download so I can purchase the SD

  • Tween with as 3.0

    I want to tween 3 balls after one and other wit AS3. I have linked the ball to the transition object in the library Short described: The next ball should start when the first balls animation is finished. The firts ball1: var ball:MovieClip = new Ball

  • Filtering by Keyword

    Using LR2.3, XP This suggestion comes out of a recent thread in the help forums about filtering for multiple keywords. As respondents pointed out in the thread, there are, in LR2, easy ways to do this, including making Smart Collections with multiple