Posted By:
Luca_Ventura
Posted On:
Sunday, July 29, 2001 09:45 AM
I have written an applet that import the following libraries with the statements: import java.io.*; import java.net.URL; import java.net.*; import java.applet.Applet; import java.awt.*; // Api that implement cryptographic functionalities written by IAIK import iaik.java.security.Security; import iaik.java.security.SecureRandom; import iaik.java.security.NoSuchAlgorithmException; import iaik.java.security.InvalidKeyException; import iaik.java.security.NoSuchProviderException; import iaik.java.security.KeyPair; imp
More>>
I have written an applet that import the following libraries with the statements:
import java.io.*;
import java.net.URL;
import java.net.*;
import java.applet.Applet;
import java.awt.*;
// Api that implement cryptographic functionalities written by IAIK
import iaik.java.security.Security;
import iaik.java.security.SecureRandom;
import iaik.java.security.NoSuchAlgorithmException;
import iaik.java.security.InvalidKeyException;
import iaik.java.security.NoSuchProviderException;
import iaik.java.security.KeyPair;
import iaik.java.security.KeyPairGenerator;
import javax.crypto.Cipher;
import iaik.security.provider.*;
import iaik.security.rsa.*;
import iaik.java.security.Provider;
// I have witten the following packages:
import Borsa.*;
import supporto.*;
When I load my Web Page that contains tha applet I receive the following error in the Java console:
java.lang.NoClassDefFoundError: iaik/java/security/Key
at java.lang.Class.newInstance0(Native Method)
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)
It verifies as soon as the applet must load the first package that doesn't belong to the Java 2 Runtime Library by Sun Microsystem.
In fact "iaik.java.security" is a package written by IAIK (http://jcewww.iaik.at/) that implements cryptographic functionalities and it is included
in the .jar file called "iaik_jce_full_ae.jar" that is the "applet edition" library for iaik-jce 2.6).
I am using Windows ME as Operating System, Netscape 6 as Web Browser, Apache 1.3.2 (for Windows) as HTTP Server.
I have some questions:
1)Does the Web Browser allow me to download all the code (classes) of the packages that the applet needs to work?
I suspect that the Web Browser let me to download only the code of the applet and not the code of all classes files that it imports (with the only exception of the classes included in the Java 2 Standard edition that the Java interpreter present in the Web Browser knows).
2) In this case: what does a user have to do to download correctly the applet?
3) Can I write my own packages (like "Borsa" and "supporto") and import them in the applet code?
4) What a user that connects to my web site must do to download the applet and all the packages
that it needs to work?
5)Is there a way to indicate to the Java Virtual Machine of the Browser the location of the packages that it must import together with the applet code?
With Internet Explorer I obtain the same error but this time with the "Borsa.*" package.
"Borsa" is a folder (and not a. jar or a .zip file) present in the same location where I put my applet code (.class) on my http server.
All the other .jar files that I included in the applet code are in a special folder on my http server that I indicated in the environment variable "CLASSPATH".
I inserted the applet in my web page in this way:
I hope someone can help me!Thank you very much in advance!!!
Luca Ventura
<<Less