Signing Applets

Hi,
I've just completed work on an applet to allow users of a teleradiology system to open DICOM images from a PACS system over a network. However, on installation at the client site today, it would not open images from the PACS (the web server and image server have different IP addresses).
Is this problem related to applet signing?
If it is, is there any way I can bypass the need to sign an applet?
Regards,
James

In order to sing your applet you need to generate a self certified certificate. Follow these steps ( I am using J2SE 1.4.1)
1) keytool -genkey //this will create a keyfile called "mykey"
2) keytool -selfcert mykeym //this will generate a certificate
3) you need to generate a .jar file for the applet to run it
4) jar cvf ab.jar ab.class // create the jar file
5) jarsigner ab.jar mykey  // sign the jar file
6) jarsigner -verify ab.jar //verify if the jar file is signedhttp://www.javagalaxy.com:8080/Java.jsp

Similar Messages

  • 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 ...

  • 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.

  • Prevent abuse of a signed applet?

    Hi
    I am creating an application using HTML, javascript, and a set of java classes.
    Communication betwwen the javascript and java is done by an applet, signed with a real certificate.
    I would like to prevent someone copying my signed jar, and abusing it.
    The classes behind my applet will do (a.o.) local I/O.
    The type of abuse I am worried about is e.g. java code from another jar calling public methods on classes in my signed jar, using them to read or write files, and thus abusing my certificate for doing something else than my applet/jar was meant to.
    I am looking for advice on how to prevent such things from happening.
    Thoughts that already crossed my mind, are:
    - making sure only my applet (and as few as possible other classes) has a public constructor
    - declaring as much classes as possible (at least the sensitive classes) as final
    - avoid non-final public static variables that contain default names of files
    If anyone has some more ideas, please post them! I'll be very gratefull!
    If you know about a similar question (and answer) in this forum, please let me know, as I have not found it.

    harmmeijer,
    thanks for the answer, and especially the idea of checking the call stack!
    You scared the hell out of me however, by saying:
    Your applet would not work at all in jre 1.4.2 signed or policy, when the method is called by javascriptand reading the thread you referenced!
    Everything worked fine in jre 1.4.1_2 and earlier. It continued working in 1.4.2_01 in combination with Netscape (v 7.1)
    But the combination MSIE (v6.0) with jre v1.4.2_01 did require a minor change:
    From my signed applet, I called a .class.getResource(...).getURL()
    It didn't work anymore, so I do it know in my applet's init() method, instead of in a stack started by javascript.
    All my other I/O (and reflection) still works (thank all gods!), since I do it in a separate thread that I start in my applet's init() method. I hope it keeps working in jre 1.5 :-)
    Any other input is very welcome!

  • Signed Applet not loading on Mac OS X if using HTTPS protocol

    Hi All,
    I need to open a trusted applet on Mac OS 10.2. The applet works fine if using HTTP protocol. But if the protocol used is HTTPS the the applet does not loads and "javax.net.ssl.SSLException - untrusted server cert chain" exception comes on the console.
    The error comes for both - Verisign and javakey - signed applet.
    On seaching for possible solution on the net, i came across following link: http://www.macosxhints.com/article.php?story=20020525101202503&query=Workaround+for+secure+Java+applet+problems
    It says that this is Mac's known bug and gives the workaround as:
    1. Access the problematic site with Internet Explorer on Windows. Click on the padlock item and export the certificate to a file.
    2. Copy the certificate to your Mac.
    3. Use the command
    sudo keytool -import -trustcacerts -keystore /Library/Java/Home/lib/security/cacerts -file mycert.cer
    to import the certificate file to your keystore (substitute mycert.cer with the name of the file containing the certificate). The keystore is password protected - the default password is "changeit".
    4. Restart your browser
    But the client cannot be asked to do all this to run the applet.
    Is this problem being solved by Mac in their java implementation or is there any other possible solution?
    Thanx in advance.
    Regards,
    Charu

    I am experiencing the same problem - I notice it does not happen on OS9.2 using IE but appears a problem on all browsers on OSX
    Apple gave me the following reply.....
    Re: Bug ID# 3268633: cannot load applet class under https connection
    Hello Andrew,
    Thank you for bringing this problem to our attention. We have received feedback
    from engineering on your
    reported issue.
    Please know that to get Java to recognize the certificate you will need to do
    one of two things, depending
    on which VM you are using. Since you want it to work with Internet Explorer, we
    will assume Java 1.3.1.
    In Java 1.3.1 you'll need to add the certificate to
    /Library/Java/Home/lib/security/cacerts using
    /usr/bin/keytool to import the certificate into the certificate database.
    In Java 1.4.1 you should be able to just add the certificate to the keychain
    using certtool. For more
    details on how to do this, please refer to the information found at
    <http://java.sun.com/j2se/1.4.1/docs/tooldocs/solaris/keytool.html>. After
    doing so, if you should require
    further help from Apple in resolving this issue, we recommend that you request
    assistance from Developer
    Technical Support. This must be done by filing a Technical Support Incident.
    So I am supposed to tell every Mac user to do the above am I?!!!

  • OS X 10.5.6, Safari 3.2.1 hangs when second applet loaded is signed applet

    Dear Forum,
    I've been investigating a customer's problem. She is trying to use our
    VoIP applet, but it continuously freezes Safari when the Trust dialog shows.
    A "Force Quit" is necessary.
    I managed to reproduce the problem consistently on
    - PowerMac7 OS X 10.5.6 (Build 9G55)
    - Architecture: ppc
    - Safari 3.2.1 (5525.27.1)
    - JVM 1.5.0_16 from Apple
    The problem is persistent when:
    - the signed applet is loaded as second applet in the browser
    - the signed applet is cached by the JVM
    Our customer uses:
    - Mac Book ProOS X 10.5.6
    - Safari 3.2.1
    - JVM 1.5.0_16 from Apple
    This problem does not occur on:
    - Mac OS X 10.4.11 (Mac Powerbook G4)
    - Safari 3.2.1 (4525.27.1)
    - JVM 1.5.0_16 from Apple
    and not on:
    - MacBook Air, OS X 10.5.6, 1.6 Ghz Intel core 2 duo
    - Safari Version 3.2.1 (5525.27.1)
    - JVM 1.5.0_16 from Apple
    Steps to reproduce the problem:
    Launch Safari.
    In (first) page/tab go to
    http://www.javatester.org/version.html
    (this uses a non signed applet)
    Open a second tab. Here go to:
    http://ukapi.phonefromhere.com/talk/vtop2.xsql?key=01612884242
    This is a signed applet that will ring our office over VoIP.
    Click the "Trust" button (signed by PhoneFromHere).
    As long as this applet isn't cached by the JVM this will work, so
    the first time you will succeed.
    Now Quit Safari (not "just" close all Safari windows, but a "real" quit) and repeat the exercise.
    The second (and next) time this will fail (only if the signed applet is loaded as second, so the order is important)! This keeps failing until I go (back) to the Java Preference window (via Finder) and explicitly delete the cached files.
    The URL will work when loaded first (cached or not).
    Some diagnostics, that might help:
    I configured the Java Preference window to "enable Logging, Tracing and Show applet livecycle exceptions".
    When the applet fails to load (and Safari freezes/hangs), the last few records of the plugin150.log are:
    <message>basic: Loading http://ukapi.phonefromhere.com/talk/lib/pfh.jar from cache
    <message>basic: Reading cached JAR file from JRE 1.5 release
    <message>basic: Certificates for http://ukapi.phonefromhere.com/talk/lib/pfh.jar is read from JAR cache
    <message>security: Loading certificates from Deployment session certificate store
    <message>security: Loaded certificates from Deployment session certificate store
    <message>security: Checking if certificate is in Deployment session certificate store
    (and then nothing)
    whereas when it succeeds to load, as soon as I click the "Trust" button, it's say:
    <message>security: User has granted the priviledges to the code for this session only
    The Report is a bit too long to port, I'll include the same text above when sending it.
    Model: PowerMac7,2, BootROM 5.1.3f0, 2 processors, PowerPC 970 (2.2), 1.8 GHz, 2 GB
    To cut a long story short? Is this a know bug (I couldn't find anything, but you never know)? Does anyone have any ideas how to fix this?
    Thanks, Birgit

    I have the same issue now after downgrading my Flash plugin. I downgraded from 10 to 9 latest because I like using Camino and for some reason Flash 10 doesn't play nice with Camino. But all of a sudden as I use Camino 2b2 for everyday and Safari 3.2 for banking and such, the browser hangs requiring a forced quit when I close it. I've re-installed the browser twice now with all the previous folders, and preferences erased and caches emptied. I even when to re-installing 10.5.6 and it still crashes, it's odd. Maybe 10.5.7 will address this.

  • File read access denied for signed applet

    Hi:
    I have a signed applet with a certificate generated with the keytool. Yet, I keep getting this error:
    java.lang.Exception: java.security.AccessControlException:
        access denied (java.io.FilePermission C:\WINDOWS\system32\aetpkss1.dll read)The error is produced when the method loadKeyStore(pin) below is called.
        private KeyStore ks;
        private Provider provider;
        private static final String providerName    = "PKCS11";
        private static final String providerLibrary = "aetpkss1.dll";
        public void loadKeyStore(String pin) throws IOException,
         CertificateException, KeyStoreException, NoSuchAlgorithmException {
         if (provider == null)
             registerProvider(providerLibrary);
         try {
             ks = KeyStore.getInstance(providerName,provider);
         } catch (Exception e) {
             throw new KeyStoreException("Failed get keystore instance\n"
                             + e.getMessage());
         try {
             ks.load(null, pin.toCharArray());
         } catch (Exception e) {
             throw new KeyStoreException("Failed load keystore\n"
                             + e.getMessage());
        public void registerProvider(String library)
         throws FileNotFoundException, KeyStoreException {
         String fileName;
         if (new File(library).isAbsolute())
             fileName = library;
         else
             fileName = getAbsolutePath(library);
         if (!(new File(fileName).exists()))
             throw new FileNotFoundException("No such file: " + fileName);
         String config = "name = " + providerName + "\n"
             + "library = " + fileName;
         ByteArrayInputStream confStream =
             new ByteArrayInputStream(config.getBytes());
         try {
             provider = new sun.security.pkcs11.SunPKCS11(confStream);
             Security.addProvider(provider);
         } catch (Exception e) {
             throw new KeyStoreException("Can initialize " +
                             "Sun PKCS#11 provider. Reason: " +
                             e.getCause().getMessage());
        private String getAbsolutePath(String lib) throws FileNotFoundException {
         String[] searchPath;
         /* NOTE: This should be modified to suit different versions of   *
          *       Windows and not just Windows XP                         */
         if (System.getProperty("os.name").matches("^(?i)Windows.*")) {
             searchPath = new String[] { "C:\\WINDOWS\\system32" ,
                             "C:\\java" };
         } else {
             searchPath = new String[] { "/usr/local/lib/" };
         for (int i = 0; i < searchPath.length; i++) {
             if ((new File(searchPath[i] + File.separator + lib).exists()))
              return (searchPath[i] + File.separator + lib);
         throw new FileNotFoundException("Library not in search path " + lib);
        }The above code is called by a java script, the class' constructor is empty.
    The error appears not to be caught by my code. I have tried to insert try/catch statements everywhere to figure out where this error is produced.
    The code is write off of the applet for signing with a smart card by Svetlin Nakov - and his applet works!
    I have also made a CLI application that uses the above code and it works perfectly.
    So: Something is wrong either with my certificate, the signing method, signature verification or something completely different. Any hints?
    The certificate I generated with
    keytool -genkey -keystore mystore -alias me
    keytool -seflcert -keystore mystore -alias meI have tired both with and without the selfcert step.
    Thanks! Erik

    The problem has been identified: Placing registerProvider() in the constructor the error no longer occurs, instead an error is produced when the key store is loaded.
    It appears that the javascript code is not trusted and so, even though the applet is signed, access privileges are restricted to those of the java script.
    A solution to this problem is not clear, but possibly, serving the pages from a trusted server, the java script will be trusted, some documentation seem to indicate.

  • Problems with signed Applet for File Download under JRE 1.4 (works with 1.3

    Dear all,
    i encountered a very strange behaviour with JRE 1.4x. A signed applet used for file download worked on all platforms (Windows NT, 2000 and XP wth/wthout SP...) until I installed JRE 1.4.x (1.4.1 or 1.4.2)
    I get an EOFException when downloading binary files (for ASCII it works fine) when trying to readByte() from a DataInputStream. But not immideately, but after x bytes in the while-loop. Security is fine (I know there have been changes to that in jre 1.4, the applet itself can be started an runs with ASCII files for transfer)
    Does anyone know, what has changed in jre1.4.
    As I said, it works fine under jre 1.3.x
    The relevant code is below: byte bt = dis.readByte(); causes the error
    try{
    // Get URL from Server
    URL uFile = new URL(sFilename);
    sThisURLFile = uFile.getFile();
    Integer inte = new Integer(i);
    //open input stream for the file on server
    DataInputStream dis = new DataInputStream(new BufferedInputStream
    (uFile.openConnection().getInputStream()));
    //open output stream for the file on local drive
    String sFilenameOnly = sThisURLFile.substring(sThisURLFile.lastIndexOf('/')+1);
    int iDotPos = sFilenameOnly.lastIndexOf(".");
    String sExt;
    if (iDotPos > 0) {
    sExt= sFilenameOnly.substring(iDotPos);
    } else {
    sExt = "";
    File fileOut = new File(sDownloadDir + sThisURLFile.substring(sThisURLFile.lastIndexOf('/')+1) );
    DataOutputStream dos = new DataOutputStream(new
    BufferedOutputStream(new FileOutputStream(fileOut)));
    //read one byte from input stream, and write that byte to output stream
    long nByte = 0;
    int iCnt = 0;
    iFilesizeDone ++;
    while (nByte < iFilesize){
    String sErrPs = new String();
    try{
    sErrPs = "00";
    byte bt = dis.readByte();
    sErrPs = "01";
    dos.writeByte(bt);
    } catch (EOFException ee)
    System.err.println("internal EOFException: " + ee.getMessage());
    System.out.println("Error Filesize is " nByte " of " iFilesize "---" + sErrPs);
    break;
    nByte++;
    iFilesizeDone ++;
    iCnt ++;
    if(iCnt >= 10240) {
    ShowProgress(nByte, iFilesize, iFilesizeDone, iFilesizeTotal); // repaint does not work during init-procedure
    iCnt = 0;
    line = "Progress: Total: " + ((iFilesizeDone*100)/iFilesizeTotal) + " perc, " + iFilesizeTotal/1024 +" kbytes" ;
    labLine.setText(line);
    //dos.flush(); // improves Client performance (Agent-Call!)
    dis.close();
    dos.close();
    }// End try
    catch (EOFException ee)
    System.err.println("EOFException: " + ee.getMessage()e);
    catch (SecurityException se)
    System.err.println("SecurityException: " + se.getMessage());
    catch (IOException ioe)
    System.err.println("IOException: " + ioe.getMessage());

    perhaps they've changed something with the file blocking.
    btw, you should try to use something like this
    DataInputStream dis = new DataInputStream(is);
    byte[] buffer=new byte[8192];
    int numBytesRead;
    while ( dis.available()>0 ) {
         numBytesRead = dis.read(buffer);
    }               

  • Signed applet for file download?

    Hello folks,
    I have a signed applet through which i can upload multiple files to a servlet. I wish to create another applet or enhance this one to enable it to download multiple files from the server to the client m/c. Any idea, how to go about it?
    I will appreciate your helpful replies.
    Thank you,
    Coreli

    which part? You apparently already know how to sign an applet... and use a file chooser... and create servlets that can take files.... seems you need to do the opposite and use input streams where you used output streams before and vice versa...

  • Signed Applet problems in Vista + JMF

    Hi All,
    I'm new to Java Applet programming. I wrote an application which works as a VoIP Client in a webpage (Using JMF). Its working very fine in allmost all Windows XP machines.
    But not in Windows Vista machines. In Vista i'm getting the following error :
    "No permission to capture from applet" - Since its a Signed applet. The application is digitally signed from a CA. Even though its not working in Vista (IE and Mozilla Firefox also).
    I have went through the following link which says IE in Vista will run on protected mode, so Signed Applet will not have all the permission eventhough its signed for "AllPermission".
    ----- http://java.sun.com/javase/6/webnotes/install/system-configurations.html
    And also I'm not able to create a customized jar file for JMF using JMF Customizer. (JMF Customizer is an application which creates a jar file with specified classes). While creating a jar file I'm getting particular class is not available. (In Windows XP, this class is compilled at run time).
    Please let me know the following things,
    a) Is there any security settings i have to make to run Signed Applet in Windows Vista ?
    b) What is Java Policy file? I don't have any policy file - will it affect the application ?
    c) Do I need to sign each applet (say i have 5 applets in single jar file) ?
    d) In Vista how Mozilla Firefox are running (like IE7's restricted environment or XP compatiable mode) ?
    Thanks in Advance,
    Karthikeyan R

    I have exatly the same problem but not with the class itself. I have the problem with an jar that my class calls.
    I use jdk1.4.2. I think it's basicaly the same problem as "lfpgMW".
    I'll also whould like an idea...
    thanks

  • Setting the: signed.applets.codebase_principal_support to true is not working ( keeps asking to set it to true)

    i've Set the Boolean string to true but when i try to copy paste in firefox it just gives me the message again
    ( you need to set the signed.applets.codebase_principal_support to true )
    Is this a know bug ?
    thanks.

    Try this extension - Allow Clipboard Helper: <br />
    https://addons.mozilla.org/en-US/firefox/addon/852

  • Safari will not run a signed applet on mac os x 10.5.7 with new Java update

    Hi Everyone,
    I've got a problem that hopefully you guys can help me solve. I have an applet that runs on windows, mac and linux that is signed by a verisign certificate my work has. The certificate is valid and everything works just fine on windows and linux, but after I upgraded our macs with the newest java update for mac (which gave macs Java 1.6.13), the applets won't work. When the applet is loaded in Safari or Firefox, it asks if I want to trust the certificate. When I tell it to trust it, Safari comes back with a message saying that it will not trust the code and will treat it as unsigned code.
    For a long time the applet was built and signed on windows, but now it can be built and signed on windows and mac. Building and signing on either platform gives the same results and the mac signed applet works just fine on windows.
    Has anyone else run across this problem? Any help or advice will be appreciated.
    Thanks,
    Robbie

    BenGlancy wrote:
    How did you tell it to fully trust it? I thought the dialog comes up asking the user whether to trust it.
    I only ask because it's not practical to expect all users to dig around for settings to trust a particular certificate.They don't have to dig around. When a signed Applet is loaded, if the certificate chain contains a certificate not in the trust store then a dialogue box asks the user if he wants to run it anyway. This dialogue box also has check box to indicate the the user should always trust this certificate and checking this means the user will not be asked again.

  • Java Applet Window showing on signed applet popups

    I have an applet deployed that is signed, but I'm experiencing a very annoying problem with JPopup windows that cross outside the border of the JFrame created by the Applet.
    Those pop-up windows still show the warning at the bottom "Java Applet Window". That part is pretty annoying and I don't understand why it's doing that since they are coming from a signed, trusted applet.
    Just to be clear, any of the JPopups or JDialogs or anything else we display inside the frame doesn't have this warning since we signed the applet.

    Our team is also using a signed applet and are having trouble with popup items not being accessible outside of the JFrame.
    In appletviewer the popup (JXDatePicker) is fully accessible. If running in Internet Explorer on Windows 2000 the portion of the popup outside of the JFrame paints correctly but cannot receive click events correctly.
    It would be preferrable that if the popup cannot receive events outside of the applet frame that the popup would be smart enough to pop itself fully in the applet frame.
    Any suggestions?
    Thank you.

  • Change language on the security warning popup when using signed applets

    Hi
    Today when we use a signed applet the user get a security warning popup box where the langauge is English.
    Is it possible to change the language to other that English and if possible how can this be done ?
    Thanks in Advance,
    Henrik Rasmussen
    Denmark

    The Microsoft one is especially annoying because they should know better than to submit from secure to insecure.
    Let's say you are currently logged in to a Microsoft account and you click Sign in on MSDN. The site redirects to login.live.com, which recognizes that you are logged in, and generates a page with a hidden form and submits it back to MSDN using a script. This is where the problem is, because the hidden form action URL is not secure, yet it is on a secure page. (See Screen shots)
    The workaround (hack, whatever) is to modify the form to a secure address before it is submitted. How can you do that? Since it is impractical to do by hand, you can use an add-on.
    In an earlier thread, user thx1200 posted a link to a userscript that fixes this issue on login.live.com. The userscripts''.''org site has seemingly died, but there is a copy on a mirror of that site.
    * Earlier thread (long): [https://support.mozilla.org/questions/964250 How do disable this Warning? Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection]
    * You need Greasemonkey to run user scripts: https://addons.mozilla.org/firefox/addon/greasemonkey/
    * User script install page: [http://userscripts-mirror.org/scripts/show/173384.html Fix security warning for Microsoft Live login]

  • Classloader caching in signed applet is very slow and weird

    I have a signed applet running in the 1.4.1_01 plugin environment, and
    I'm getting the following kinds of messages when I use debug mode 5 in the console:
    Connecting http:[myserver]/someclass.class with no proxy
    Connecting http:[myserver]/someclass.class with cookie "JSESSIONID=..."
    Sometimes, the classloader will say:
    WARNING: Unable to cache someclass.class
    Moreover, some classes will be repeated two or three times, as if the classloader is trying to get the same class two or three times.
    Some of these classes are even in the java.lang package!!
    The thing is, I'm actually trying to get the applet to use webservices, so I've signed the Apache Axis jar files (about 8 or so) and included them in the "cache_archive" parameter. The classes giving problems are from these archives, not from my main applet jar.
    The applet will eventually work, but the first time takes a LONG time to initialize because the classloader is trying to verify all the classes (i think). Subsequent runnings of the applet within the same browser will be much faster, but the same thing will happen if I start a new browser instance.
    My questions are:
    1) Why is the classloader trying to load from my http server rather than from the local jars? (they seem to be statically cached, I checked the plugin control panel)
    2) Why is the classloader reloading the same classes multiple times?
    3) Is the classloader verifying the signatures for each class, because it's taking a long time due to very many classes (100's).
    I can't seem to find ANY documentation for this at Sun or Google.
    Please help if you can!
    Andrew

    I've got the same problem with applet using SOAP based on jwsdp.
    But classloader only try to get classes from server that are used in SOAP calls.
    The only workaround I found is to move this classes to root package, but still there are problems with
    Connecting http://<host>/int.class with no proxy
    Connecting http://<host>/int.class with no proxy
    WARNING: Unable to cache http://<host>/int.class
    requests.
    Maybe this is a bug of Sun SOAP implementation?

Maybe you are looking for