2
votes

i have an applet in my application when i invoke my jsp i have this error

java.lang.ClassNotFoundException: VisualisationCourbeCharge.class 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) at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source) at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

My code:

    StringBuffer applet = new StringBuffer();
    applet.append("<object classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\" ");
    applet.append("width = \"750\" height = \"500\" hspace = \"0\" vspace = \"0\" align = \"middle\">\n");
    applet.append("\t<param name=\"archive\" value=\"jfreechart-0.9.8.jar,jcommon-0.8.0.jar\">\n");
    applet.append("\t<param name=\"codebase\" value=\"./ihm/applet/graphe/\">\n");
    applet.append("\t<param name=\"code\" value=\"VisualisationCourbeCharge.class\">\n");
    applet.append("\t<param name=\"");
    applet.append(ConstantesApplet.PARAMETRE_LANGUE);
    applet.append("\" value=\"");
    applet.append(langue);
    applet.append("\">\n");


<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width = "750" height = "500" hspace = "0" vspace = "0" align = "middle">
    <param name="archive" value="jfreechart-0.9.8.jar,jcommon-0.8.0.jar">
    <param name="codebase" value="./ihm/applet/graphe/">
    <param name="code" value="VisualisationCourbeCharge.class">
    <param name="langue" value="fr">
    <param name="unit" value="MW">
    <param name="powerUnit" value="">
    <param name="nomColonne" value="Valeur">
    <param name="dateDebut" value="2007-02-01T00:00:00">
    <param name="duree" value="1">
    <param name="decalage" value="7">
    <param name="nombreMaxJours" value="32">
    <param name="anterieur" value="false">
    <param name="existePuissanceSouscrite" value="false">
    <param name="listColumn" value="Valeur;">
    <param name="valuesTime" value="2007-02-01T00:00:00;2007-02-01T00:10:00;2007-02-01T00:20:00;2007-02-01T00:30:00;2007-02-01T00:40:00;2007-02-01T00:50:00;2007-02-01T01:00:00;2007-02-01T01:10:00;2007-02-01T01:20:00;2007-02-01T01:30:00;2007-02-01T01:40:00;2007-02-01T01:50:00;2007-02-01T02:00:00;2007-02-01T02:10:00;2007-02-01T02:20:00;2007-02-01T02:30:00;2007-02-01T02:40:00;2007-02-01T02:50:00;2007-02-01T03:00:00;2007-02-01T03:10:00;2007-02-01T03:20:00;2007-02-01T03:30:00;2007-02-01T03:40:00;2007-02-01T03:50:00;2007-02-01T04:00:00;2007-02-01T04:10:00;2007-02-01T04:20:00;2007-02-01T04:30:00;2007-02-01T04:40:00;2007-02-01T04:50:00;2007-02-01T05:00:00;2007-02-01T05:10:00;2007-02-01T05:20:00;2007-02-01T05:30:00;2007-02-01T05:40:00;2007-02-01T05:50:00;2007-02-01T06:00:00;2007-02-01T06:10:00;2007-02-01T06:20:00;2007-02-01T06:30:00;2007-02-01T06:40:00;2007-02-01T06:50:00;2007-02-01T07:00:00;2007-02-01T07:10:00;2007-02-01T07:20:00;2007-02-01T07:30:00;2007-02-01T07:40:00;2007-02-01T07:50:00;2007-02-01T08:00:00;2007-02-01T08:10:00;2007-02-01T08:20:00;2007-02-01T08:30:00;2007-02-01T08:40:00;2007-02-01T08:50:00;2007-02-01T09:00:00;2007-02-01T09:10:00;2007-02-01T09:20:00;2007-02-01T09:30:00;2007-02-01T09:40:00;2007-02-01T09:50:00;2007-02-01T10:00:00;2007-02-01T10:10:00;2007-02-01T10:20:00;2007-02-01T10:30:00;2007-02-01T10:40:00;2007-02-01T10:50:00;2007-02-01T11:00:00;2007-02-01T11:10:00;2007-02-01T11:20:00;2007-02-01T11:30:00;2007-02-01T11:40:00;2007-02-01T11:50:00;2007-02-01T12:00:00;2007-02-01T12:10:00;2007-02-01T12:20:00;2007-02-01T12:30:00;2007-02-01T12:40:00;2007-02-01T12:50:00;2007-02-01T13:00:00;2007-02-01T13:10:00;2007-02-01T13:20:00;2007-02-01T13:30:00;2007-02-01T13:40:00;2007-02-01T13:50:00;2007-02-01T14:00:00;2007-02-01T14:10:00;2007-02-01T14:20:00;2007-02-01T14:30:00;2007-02-01T14:40:00;2007-02-01T14:50:00;2007-02-01T15:00:00;2007-02-01T15:10:00;2007-02-01T15:20:00;2007-02-01T15:30:00;2007-02-01T15:40:00;2007-02-01T15:50:00;2007-02-01T16:00:00;2007-02-01T16:10:00;2007-02-01T16:20:00;2007-02-01T16:30:00;2007-02-01T16:40:00;2007-02-01T16:50:00;2007-02-01T17:00:00;2007-02-01T17:10:00;2007-02-01T17:20:00;2007-02-01T17:30:00;2007-02-01T17:40:00;2007-02-01T17:50:00;2007-02-01T18:00:00;2007-02-01T18:10:00;2007-02-01T18:20:00;2007-02-01T18:30:00;2007-02-01T18:40:00;2007-02-01T18:50:00;2007-02-01T19:00:00;2007-02-01T19:10:00;2007-02-01T19:20:00;2007-02-01T19:30:00;2007-02-01T19:40:00;2007-02-01T19:50:00;2007-02-01T20:00:00;2007-02-01T20:10:00;2007-02-01T20:20:00;2007-02-01T20:30:00;2007-02-01T20:40:00;2007-02-01T20:50:00;2007-02-01T21:00:00;2007-02-01T21:10:00;2007-02-01T21:20:00;2007-02-01T21:30:00;2007-02-01T21:40:00;2007-02-01T21:50:00;2007-02-01T22:00:00;2007-02-01T22:10:00;2007-02-01T22:20:00;2007-02-01T22:30:00;2007-02-01T22:40:00;2007-02-01T22:50:00;2007-02-01T23:00:00;2007-02-01T23:10:00;2007-02-01T23:20:00;2007-02-01T23:30:00;2007-02-01T23:40:00;2007-02-01T23:50:00;">
    <param name="valuesNominal" value="0.5;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;">
    <param name="valuesFormer" value="">
    <param name="valuesPower" value="">
</object>

It works under JRE 1.4 but not in the JRE 1.6

3
Are you sure the jars path is accessible from the JSP , my advice would be to first test it with a simple HTML file and access it through your application url and check the console in firebugSudhakar
@Mercer is right. add the needed jar to tomcat or whatever servlet enine you are usingMoataz Elmasry
@Sudhakar yes, the jars path is accessible from the JSP.It works with a version of Java 1.4 but not with version 1.6Mercer
I just wanna know the jar file's name file in which you have this class. I just wanna try by myself and see.sakthisundar
@user592704 yes i can show the source codeMercer

3 Answers

2
votes

Add subsequent jar files into server. @Moataz Elmasry's suggestion is good.

Put your jar files into the specific directory. i.e. /bin

2
votes

Change from

<param name="code" value="VisualisationCourbeCharge.class">

to

<param name="code" value="VisualisationCourbeCharge">
2
votes

Emm...

I am not pretty sure but I just want to share my case so maybe that can help you as well...

if you saying it works for 1.4 only version then I may suggest a thing concerning your VisualisationCourbeCharge class inner structure; As I could notice, the class is not a lib one? OK... so, as I can remember, the 1.4 version works fine with inner classes... in 1.4 code like a

public class A{}
class B{}//inner class B

... as I can remember, was generating both A and B classes in the same package

but in 1.6 I was facing a problem using that code structure it was throwing java.lang.ClassNotFoundException

public class A{}
class B{}//inner class B

... because class B wasn't generated in the package (in my Eclipse IDE at least)...

So I want you to watch carefully your source files; Is the VisualisationCourbeCharge an inner class (as the sample B class)? If yes then just put it in the major class (the sample A class) braces area or make it not-a-sub-class but a separate public one and re-compile.


One more suggestion...

Have you tried to use both tags as doc says:

<object 
  classid="clsid:CAFEEFAC-0016-0000-0000-ABCDEFFEDCBA"
  <param name="code" value="Applet1.class">
    <comment>
      <embed code="Applet1.class"
        type="application/x-java-applet;jpi-version=1.6">
        <noembed>
          No Java Support.
        </noembed>
      </embed>
    </comment>
  </object>

?

This should support both IE and Mozilla

And still there are less details... Show the VisualisationCourbeCharge source code


Report if it helps