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:12]
# 1

I'll assume you have all this stuff packaged into different jar files?

On the applet archive tag, you can specify a list of jar files to download. If some of the other jars are used in the init() procedure, try putting them at the front of the list of archives.

You can get everything from the web server. The only thing that needs to be local is the runtime. If you developed using Java 2, then you also have to have the plugin installed. Using the plugin, you can even have it install extension for you ... But I haven't tried this yet.

Using the plugin is Ok for intranet applications, but extranet, could be a burden to the user, because it would have to download the runtime and plugin, and if they have a dialup line, it takes a while.

jan.svensson at 2007-6-29 9:09:47 > top of Java-index,Security,Signed Applets...