Problems loading an applet:(

Hello!

I am an italian student who is attending computer science at Pisa University.

I am developing a project and I have the following problem.

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 the Web Page that contains tha applet and I receive the following error in the Java console:

java.lang.NoClassDefFoundError: Borsa/Cliente

at java/lang/Class.getFields0

at java/lang/Class.getDeclaredFields

at java/io/ObjectStreamClass.generateSerialVersionUID

at java/io/ObjectStreamClass.<init>

at java/io/ObjectStreamClass.lookup

at java/io/ObjectOutputStream.writeNewObject

at java/io/ObjectOutputStream.writeObject

at RefreshSSL.mandaRich

at RefreshSSL.InitSSL

at RefreshSSL.init

at com/ms/applet/AppletPanel.securedCall0

at com/ms/applet/AppletPanel.securedCall

at com/ms/applet/AppletPanel.processSentEvent

at com/ms/applet/AppletPanel.processSentEvent

at com/ms/applet/AppletPanel.run

at java/lang/Thread.run

The web browser doesn't let me to download the class "Cliente" that is present in the package "Borsa" that I have written (together with the package "supporto"), but I don't know why!

I am using Windows ME as Operating System, Internet Explorer 5.5 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.

2) In this case: what does a user have to do to download correctly the applet?

Does he must have stored on his PC all the classes that applet needs (that is to say they must be stored on the client side of the application) without downloading them?

I think it is impossible because a programmer that writes an application must store all his code only on an Http Server and not on all the client machine!! Are you agree?

I tried to set the classpath variable in Windows with the location of the "Borsa" package but unsuccessful.Anyway even if this solution worked I think it wouldn't be a good one because

the user shouldn't modify his environment variables and then he doesn't have the code of the classes that the applet imports:(

I PRAY YOU TO REPLY ME TO THIS E-MAIL ADDRESS:

ventura@cli.di.unipi.it

Thanks a lot to all in advance!

Luca Ventura

[3440 byte] By [ventural] at [2007-9-26 2:14:11]
# 1
basically you get these kind of errors because of not setting classpathset the class path to packages you created of your own
rama_1 at 2007-6-29 9:09:46 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
as told by the pervious member errors of this kind are due to the fact that the vm is unable to locate the class requested which means that either such a class doesnt exist or u havent compiled the class or u havent set the classpath. GP.
ga11 at 2007-6-29 9:09:46 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

Hi,

Since you are using Cryptography concept, make sure that you have used the corresponding jar files in the classpath. Also please let me know which webserver you are using. Sometimes, in certain webserver, you have make changes in the configuration files of it, in order to set the classpath. eg. Iplanet web server.

I hope this will help you.

Thanks

Bakrudeen

bakrudeen_indts at 2007-6-29 9:09:46 > top of Java-index,Java HotSpot Virtual Machine,Specifications...