Ich versuche, ein Java-Applet mit dem OBJECT> -Tag < einzubetten, die XHTML Strict ist, dies zu tun.ClassNotFoundException in Java Applet mit <object> Tag
Nach vielen Websites surfen, habe ich versucht, this example das ist ziemlich gut zu funktionieren scheint:
dass Sample2.jar<!--[if !IE]> Firefox and others will use outer object -->
<object classid="java:Sample2.class"
type="application/x-java-applet"
archive="Sample2.jar"
height="300" width="450" >
<!-- Konqueror browser needs the following param -->
<param name="archive" value="Sample2.jar" />
<!--<![endif]-->
<!-- MSIE (Microsoft Internet Explorer) will use inner object -->
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab"
height="300" width="450" >
<param name="code" value="Sample2" />
<param name="archive" value="Sample2.jar" />
<strong>
This browser does not have a Java Plug-in.
<br />
<a href="http://java.sun.com/products/plugin/downloads/index.html">
Get the latest Java Plug-in here.
</a>
</strong>
</object>
<!--[if !IE]> close outer object -->
</object>
<!--<![endif]-->
Ich heruntergeladen und perfekt auf localhost funktioniert.
Jetzt habe ich Sample2.class für die eine, die ich verwenden muss (ar.uba.exactas.infovis.ivides.Scatterplot.class) und meine eigenen JAR-Dateien (archive = "piccolo.jar piccolox.jar netscape .jar scatterplot.jar "):
<!--[if !IE]> Firefox and others will use outer object -->
<object
classid="java:ar.uba.exactas.infovis.ivides.Scatterplot.class"
type="application/x-java-applet"
archive="piccolo.jar piccolox.jar netscape.jar scatterplot.jar"
height="300" width="450" >
<!-- Konqueror browser needs the following param -->
<param name="archive" value="piccolo.jar piccolox.jar netscape.jar scatterplot.jar" />
<!--<![endif]-->
<!-- MSIE (Microsoft Internet Explorer) will use inner object -->
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab"
height="300" width="450" >
<param name="code" value="ar.uba.exactas.infovis.ivides.Scatterplot" />
<param name="archive" value="piccolo.jar piccolox.jar netscape.jar scatterplot.jar" />
<strong>
This browser does not have a Java Plug-in.
<br />
<a href="http://java.sun.com/products/plugin/downloads/index.html">
Get the latest Java Plug-in here.
</a>
</strong>
</object>
<!--[if !IE]> close outer object -->
</object>
<!--<![endif]-->
Nach so tun, ich bin gerade dieses Protokoll dump:
java.lang.ClassNotFoundException: ar.uba.exactas.infovis.ivides.Scatterplot.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.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)
Caused by: java.io.IOException: open HTTP connection failed:http://localhost/infovisUBA/2008-2C/tpfinal/bin/ar/uba/exactas/infovis/ivides/Scatterplot/class.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
Excepción: java.lang.ClassNotFoundException: ar.uba.exactas.infovis.ivides.Scatterplot.class
Der einzige Unterschied, den ich sehe, ist, dass ich eine Klasse in einem Paket bin mit .
Auch, bitte beachten Sie, dass ich dies mit dem < APPLET> -Tag gemacht habe, aber ich kann es nicht mit < OBJECT> machen.
Irgendwelche Hinweise?
versuchten beide, aber Probleme in beiden IE und FF. Gute Beobachtung, danke. – Seb
Es würde wirklich helfen, wenn Sie Ihre Frage mit dem HTML aktualisieren könnten, mit dem Sie tatsächlich Probleme haben, und nicht mit dem Beispiel, das funktioniert. –
Ja, danke. Jetzt aktualisiert – Seb