Signing applets: Classnotfoundexception

Hi everyone,
I've created a web application that contains an applet as well. In that applet ,the user should be given the opportunity to open and save files from and to a directory on his own computer. I've read alot of things about signing applets to make that possible, but I haven't managed to get a working application yet.
This is what I've done till now:
I created a bat file containing the following script:
set path=C:\Program Files\Java\jdk1.5.0_05\bin
keytool -genkey -keystore applet\AppletKeystore -keyalg rsa -alias myApplet -storepass 123456 -keypass 789012
keytool -selfcert -alias myApplet -keystore applet\AppletKeystore -storepass 123456 -keypass 789012
keytool -export -keystore applet\AppletKeystore -alias myApplet -storepass 123456 -file applet\appletPublicKey.cer
jar cvf applet\theContent.jar applet\*.class applet\appletPublicKey.cer
jarsigner -verbose -keystore applet\AppletKeystore -storepass 123456 -keypass 789012 applet\theContent.jar myApplet
htmlConverter templates.jsp
I saved the file and I ran it. I got a keystore, a cer file and a jar file in my applet directory. So far so good, I guess.
After that, I added an extra parameter in my jsp file so I get the following code:
<jsp:plugin type="applet" archive="applet.theContent.jar" jreversion="1.5" code="applet.TemplateCreatorApplet.class" codebase="." width="1280" height="800" align="middle">
        <jsp:fallback>
            Plugin tag OBJECT or EMBED not supported by browser
        </jsp:fallback>
    </jsp:plugin>Then I copied the jar file and the jsp file to the webserver. When I run my application and I want to show the applet I get an error telling me that the TemplateCreatorApplet.class file can't be found. I don't understand why I get this error when all the necessary class file are supposed to be in the jar file. Can anyone help me???
Thanks in advance,
Plunofix

Hi everyone,
i manage to solve this problem. The Classnotfoundexception raised when the applet try to find the path of the class file.
make sure when you create a jar file , you given a full path.
For example, your class file located in the com/java/test/TestApplet.class. when you create a jar file please do in the root folder
1. jar cvf TestApplet.jar com/java/test/TestApplet.class
2. jar tvf TestApplet.jar
It will display the complete path of class file.

Similar Messages

  • Signed Applet ClassNotFoundException

    I'm new to signed Applets and have ran into problems getting my Applet to load with IE Version 6. I create my jar (GUI.jar) and sign it using jarsigner and verify that the jar has a signature (see below).
    C:\mykeytools>jarsigner -keystore keys/my.keystore GUI.jar myalias
    Enter Passphrase for keystore:
    C:\mykeytools>jarsigner -verify -verbose GUI.jar
    272 Fri Jul 04 21:44:12 MDT 2008 META-INF/MANIFEST.MF
    439 Fri Jul 04 21:44:14 MDT 2008 META-INF/MYALIAS.SF
    925 Fri Jul 04 21:44:14 MDT 2008 META-INF/MYALIAS.RSA
    sm 3459 Wed Jul 02 19:48:16 MDT 2008 GUI.class
    sm 2937 Wed Jul 02 19:48:16 MDT 2008 GUI.java
    sm 232 Fri Jun 27 13:09:56 MDT 2008 .classpath
    sm 379 Fri Jun 27 13:09:56 MDT 2008 .project
    s = signature was verified
    m = entry is listed in manifest
    k = at least one certificate was found in keystore
    i = at least one certificate was found in identity scope
    jar verified.
    C:\mykeytools>
    I'm using the following in my HTML file:
    <APPLET CODE ="GUI.class" codebase = "." archive=&rdquo;GUI.jar" WIDTH=200 HEIGHT=253>
    </APPLET>
    I have also tried using the following HTML and get the same results:
    <APPLET CODE ="GUI.class" archive=&rdquo;GUI.jar" WIDTH=200 HEIGHT=253>
    </APPLET>
    The signed jar file and HTML file are in the same directory. When I execute the HTML file I get the following error:
    Java Console messages:_
    basic: Exception: java.lang.ClassNotFoundException: GUI.class
    java.lang.ClassNotFoundException: GUI.class
    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)
    Any guidance on this is appreciated.

    I found that the problem was something in my HTML file.
    The HTML that works is:
    <html>
    <head>
    <meta HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
    <meta HTTP-EQUIV="Expires" CONTENT="-1">
    <title> Applet Test</title>
    </head>
    <applet code="GUI"
    archive="GUI.jar"
    width=400 height=300>
    </applet>
    <p><img border="0" src="Company.jpg" width="326" height="88"></p>
    </html>

  • Class not found in signed applet

    Hello
    I am using a signed applet and am getting a class not found exception
    this works fine when i run it in the IDE but get the exception when i try to load the applet from the web browser in the application.
    java.lang.ClassNotFoundException: MyApplet
    at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:162)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:123)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at sun.applet.AppletClassLoader.loadCode(AppletClassLoader.java:566)
    at sun.applet.AppletPanel.createApplet(AppletPanel.java:619)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(AppletPanel.java:548)
    at sun.applet.AppletPanel.run(AppletPanel.java:299)
    at java.lang.Thread.run(Thread.java:534)
    Caused by: java.io.IOException: open HTTP connection failed.
    at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:265)
    at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:43)
    at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:152)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:149)
    ... 9 more
    I have my applet code in the applet folder
    here is my jsp call
    <applet code="MyApplet" codebase="../applet" archive="SMyApplet.jar" width=400 height=400>
    </applet>
    here is my applet code
    package applet;
    import java.applet.*;
    import java.awt.*;
    public class MyApplet extends Applet
    public void paint(Graphics g)
    g.drawString("Generate Me",50, 50);
    }

    If i do
    <APPLET CODE="xxx.class" CODEBASE="." ARCHIVE = "skshrad.jar , javax.jar" WIDTH=500 HEIGHT=500>
    is it correct?
    because it still appeared class not found error..
    This is a signed applet
    thanks..
    i try to put 2 directories in a jar also did not work..

  • Problem with a signed applet and a user machine.

    Hello. I´m having some problems with a signed applet with some dependences.
    In one particular computer the applet doesn´t load.
    The java version installed in that computer is 1.6.0_25.
    The invocation tag:
    <applet name=applet id="applet" code=Applet/RequestApplet.class width=155 height=21 archive="RequestApplet.jar " MAYSCRIPT>
       <param id="parametro1" name="usuario" value="<Computed Value>">
    </applet>The RequestApplet.jar and dependences:
       bcmail-jdk13-145.jar(signed by bouncy castle), jce-ext-jdk13-145.jar(signed by bouncy castle), AbsoluteLayout.jar, plugin.jar, RequestApplet.jar(signed by me)*this files are all in the same folder.
    The requestApplet.jar manifest:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    X-COMMENT: Main-Class will be added automatically by build
    Class-Path: bcmail-jdk13-145.jar jce-ext-jdk13-145.jar plugin.jar Abso
    luteLayout.jar
    Created-By: 10.0-b23 (Sun Microsystems Inc.)
    Main-Class: Applet.RequestApplet
    Name: Applet/ResponseApplet$1.class
    SHA1-Digest: fO5IPiwEH3OhvlprhBecmMIAVJI=
    Name: Applet/NewJApplet.class
    SHA1-Digest: 6XSpm7lQEQRi39TegoUYv2aFJrk=
    Name: Applet/ResponseApplet.class
    SHA1-Digest: v1EbKUFB+QdvO05xx8UzAMNIyRs=
    Name: Applet/ResponseApplet$4.class
    SHA1-Digest: XH4I67psXZTelpz0AMAYc/Ej8QY=
    Name: Applet/RequestApplet$1.class
    SHA1-Digest: KAP5sAC4Thv/6GClkFAdGUVzgYA=
    Name: Applet/ResponseApplet$5.class
    SHA1-Digest: CVPnKrW2SgNEkRzYnVnQe3KGrIU=
    Name: Applet/ResponseApplet$3.class
    SHA1-Digest: SjfW1k1K7BA9m3AxmHi+jvRE+9o=
    Name: Applet/ResponseApplet$2.class
    SHA1-Digest: 3Pu18CZMLuEh7/n3y7XxFSkuNQY=
    Name: Applet/RequestApplet.class
    SHA1-Digest: Tky85es5+o371adetH9XVEI2Z+o=The error:
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
         at java.lang.Class.getDeclaredConstructors0(Native Method)
         at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
         at java.lang.Class.getConstructor0(Unknown Source)
         at java.lang.Class.newInstance0(Unknown Source)
         at java.lang.Class.newInstance(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
         at java.awt.event.InvocationEvent.dispatch(Unknown Source)
         at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
         at java.awt.EventQueue.access$000(Unknown Source)
         at java.awt.EventQueue$1.run(Unknown Source)
         at java.awt.EventQueue$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.security.AccessControlContext$1.doIntersectionPrivilege(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)
    Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         ... 20 more

    Thanks. I´ll try with your tips. But if i put all the dependences in archive I get this error.
    The tag:
    <applet name=applet id="applet" CODEBASE="." code="Applet/RequestApplet.class" width=155 height=21 archive="bcmail-jdk13-145.jar, jce-ext-jdk13-145.jar, AbsoluteLayout.jar, plugin.jar, RequestApplet.jar " MAYSCRIPT>
       <param id="parametro1" name="usuario" value="<Computed Value>">
    </applet>The error:
    Java Plug-in 1.6.0_25
    Usar versión JRE 1.6.0_25-b06 Java HotSpot(TM) Client VM
    Directorio local del usuario = C:\Documents and Settings\Administrator
    c:   borrar ventana de consola
    f:   finalizar objetos en la cola de finalización
    g:   liberación de recursos
    h:   presentar este mensaje de ayuda
    l:   volcar lista del cargador de clases
    m:   imprimir sintaxis de memoria
    o:   activar registro
    q:   ocultar consola
    r:   recargar configuración de norma
    s:   volcar propiedades del sistema y de despliegue
    t:   volcar lista de subprocesos
    v:   volcar pila de subprocesos
    x:   borrar antememoria del cargador de clases
    0-5: establecer nivel de rastreo en <n>
    basic: Receptor de progreso agregado: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@f39b3a
    basic: Plugin2ClassLoader.addURL parent called for http://desarrollo.isaltda.com.uy/CertReq.nsf/bcmail-jdk13-145.jar
    basic: Plugin2ClassLoader.addURL parent called for http://desarrollo.isaltda.com.uy/CertReq.nsf/jce-ext-jdk13-145.jar
    basic: Plugin2ClassLoader.addURL parent called for http://desarrollo.isaltda.com.uy/CertReq.nsf/AbsoluteLayout.jar
    basic: Plugin2ClassLoader.addURL parent called for http://desarrollo.isaltda.com.uy/CertReq.nsf/plugin.jar
    basic: Plugin2ClassLoader.addURL parent called for http://desarrollo.isaltda.com.uy/CertReq.nsf/RequestApplet.jar

  • Signed Applet running in weblogic server

    Hi ,
    Im a newbie with applet. Can anyone help me to clarify below question.
    1. I have signed applet compile with jdk 1.4.2. It its running fine with JRE 1.4 and 1.4.2. However i need to upgrade the applet so that it can support JRE 1.6. Can anyone guide me regarding this issue as the applet will close if i running in jre 1.6. I got the below exception
    java.io.FilePermission<<allFiles>> execute.
    2. As i know, If i compiled the applet again, i need to signed the ja againr. I tried once and got below exception
    ClassNotFoundException. can anyone give any idea how resolved this problem. Fyi, im using weblogic server 8.1
    Thanks.
    Regards

    Normally, a 1.4 compiled and signed applet should work just fine under 1.6. No need to recompile and resign.
    This is in theory and in my practice with my applets. Since you do have problems, please post here (copy and paste, don't paraphrase) full stack traces of the errors and relevant code where the error occurs.

  • Multiple signed applets

    Hello,
    I'm having trouble trying to get my signed applet to work. Here's my situation:
    I've created a signed .jar file that relies on classes in another .jar file. The second .jar file comes from a 3rd party and is signed by them. I'm using IE. When trying to access the applet, I get a security dialogue box that prompts me if I want to trust the signed applet signed by me. I click yes and get an error in the java console window
    java.lang.NoClassDefFoundError: netscape/security/AppletSecurityException
    at java.lang.Class.forName0(Native Method)
    I'm assuming this is because of the 3rd pary .jar file I'm trying to use. I was not prompted to trust this .jar file. Should I have been? i have listed this other .jar file in the html file as one of the archives. Should I be using .cab files instead? What is the proper way to construct the html file when using multiple signed .jar files (signed by different parties) in conjunction with IE?
    I've gotten another simple signed applet in the form of a .jar file to work with IE just fine. But, it didn't rely on a signed 3rd part .jar file.
    Any help is greatly appreciated.
    thanks!
    -jeff

    The ClassNotFoundException for Netscape should be handled in a catch block when running in IE's native JVM. This is a bug in the code.
    You can run multiple signed applets in IE. There's no special HTML syntax to do so, just multiple applet tags. Generally, it will prompt you to accept permissions for each signed codebase.
    Eimhin

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

Maybe you are looking for

  • How do I unblock a contact in the desktop version ...

    I'm trying to get Skype working on my desktop (Windows 8.1 Pro). I am NOT a Skype user, I've downloaded the Skype desktop version onto my laptop (also a Windows 8.1 Pro machine), and have my daughter trying it from her account. However, I've discover

  • I cannot restore back my data to my Q5 ! PELASE HELP

    im in the middle of a huge problem where i have become desperate and lost, here is how it all began, first of all i received an alert that a new update is available for my Q5 which is 10.2.1537 when i started to downloanding it i received an error th

  • Adware Virus in Safari 8

    I upgraded to Yosemite and it's great but in browsing the web I think I must have picked up a virus as every time I click or type in Safari a new window opens taking me to either Mackeeper Home Page or some other Adware site which is annoying. I have

  • Unlock request denied by AT&T-what next?

    I need to use my AT&T iphone when I go back to Germany but I have not had my iphone very long. When I came back from Germany (12 yrs with Army) in late Sept 2013, one of the first things I did was to aquire a cell phone and got an iphone 4s. Like it

  • I can't view avi files - please help!

    I recently bought a Samsung Smartcam, which in the booklet says it saves in JMPEG format ("video compression format H.264, MJPEG"), however when I open the files they have been saved as AVI, which my Mac won't open. I have a MacBook Pro running the l