【发布时间】:2012-06-06 19:20:19
【问题描述】:
我想知道是否有人可以帮助我解决这个问题,因为我一直在努力让它发挥作用。
有一个现有的 Java 小程序肯定可以工作,但我需要将它从目录层次结构顶部的当前位置移动到它的深处。
运行它的原始 HTML 代码是这样的:
<html>
<applet code=DSVisApp.class
archive="jcommon-1.0.16.jar,jfreechart-1.0.13.jar,
jung-graph-impl-2.0.1.jar, jung-visualization-2.0.1.jar,
gson-1.7.1.jar, jung-algorithms-2.0.1.jar, jung-api-2.0.1.jar,
collections-generic-4.01.jar,colt-1.2.0.jar" name=DSVis height=100%
width=100%>
</applet>
</html>
(我知道,我刚刚继承了它。我想让它从新位置开始工作,然后担心切换到<object>。)
结构是:
DSVisApp
+ bin
+ + DSVisApp.class
+ + and lots of other classes for this applet
+ src
+ a couple of other directories
jcommon-1.0.16.jar
and all the other jar files with support code
这可以使用上面的 HTML。
现在我想把它放几个目录级别,例如:
alpha
+ beta
+ + gamma
+ + + delta
+ + + + DSVisApp...
+ + + + jar files...
我以为我可以只输入一个 codebase="/alpha/beta/gamma/delta" 但如果我这样做了,我会得到:
basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@1929190
basic: Plugin2ClassLoader.addURL parent called for
http://disco.local/alpha/beta/gamma/delta/jcommon-1.0.16.jar
basic: Plugin2ClassLoader.addURL parent called for
http://disco.local/alpha/beta/gamma/delta/jfreechart-1.0.13.jar
basic: Plugin2ClassLoader.addURL parent called for
http://disco.local/alpha/beta/gamma/delta/jung-graph-impl-2.0.1.jar
basic: Plugin2ClassLoader.addURL parent called for
http://disco.local/alpha/beta/gamma/delta/jung-visualization-2.0.1.jar
basic: Plugin2ClassLoader.addURL parent called for
http://disco.local/alpha/beta/gamma/delta/gson-1.7.1.jar
basic: Plugin2ClassLoader.addURL parent called for
http://disco.local/alpha/beta/gamma/delta/jung-algorithms-2.0.1.jar
basic: Plugin2ClassLoader.addURL parent called for
http://disco.local/alpha/beta/gamma/delta/jung-api-2.0.1.jar
basic: Plugin2ClassLoader.addURL parent called for
http://disco.local/alpha/beta/gamma/delta/collections-generic-4.01.jar
basic: Plugin2ClassLoader.addURL parent called for
http://disco.local/alpha/beta/gamma/delta/colt-1.2.0.jar
network: Cache entry not found [url:
http://disco.local/alpha/beta/gamma/delta/DSVisApp.class, version:
null]
network: Connecting
http://disco.local/alpha/beta/gamma/delta/DSVisApp.class with
proxy=DIRECT
network: Connecting http://disco.local:80/ with proxy=DIRECT
network: Connecting
http://disco.local/alpha/beta/gamma/delta/DSVisApp.class with cookie
"SESS59f29a0af2165ae4a0b5f5e4a22a492a=i2ds99n4hd27qoi2nida5iah67;
has_js=1"
network: Cache entry not found [url:
http://disco.local/alpha/beta/gamma/delta/DSVisApp/class.class,
version: null]
network: Connecting
http://disco.local/alpha/beta/gamma/delta/DSVisApp/class.class with
proxy=DIRECT
network: Connecting http://disco.local:80/ with proxy=DIRECT
network: Connecting
http://disco.local/alpha/beta/gamma/delta/DSVisApp/class.class with
cookie "SESS59f29a0af2165ae4a0b5f5e4a22a492a=i2ds99n4hd27qoi2nida5iah67;
has_js=1"
basic: load: class DSVisApp.class not found.
load: class DSVisApp.class not found.
java.lang.ClassNotFoundException: DSVisApp.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)
Exception: java.lang.ClassNotFoundException: DSVisApp.class
Ignored exception: java.lang.ClassNotFoundException: DSVisApp.class
basic: Loading Java Applet Failed...
反正我的头发不多 - 撕掉它会很痛。
它可能是服务器或 Java 配置的东西吗?因为很明显原始版本不是指向实际的类——实际的类是在 DSVisApp/bin/DSVisApp.class)
【问题讨论】:
-
1) “在目录层次结构的顶部” 这是否意味着“在站点的根目录”?如果不是,
codebase可能与前导/错误。 2)“然后担心切换到<object>”到时候,切换到deployJava.js,如applet info. page中所述。 3) 请在发送之前查看您的帖子,注意<object>将消失,除非代码格式化 - 它是尖括号和 HTML 注入。
标签: java html browser applet classnotfoundexception