从jar调用applet类时java.lang.ClassNotFoundException

时间:2012-06-26 13:05:04

标签: java applet classnotfoundexception rxtx

**Java Plug-in 1.6.0_31
Using JRE version 1.6.0_31-b05 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\sparkleuser
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
starting
stopping
destroying
load: class mettler not found.
java.lang.ClassNotFoundException: mettler
    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: mettler**

我在jsp文件中使用的applet标签下面

**<applet name="mettler" code=mettler archive="RXTXComm.jar,mettler.jar" width="100" height="30"></applet>**

在上面的异常中,mettler也是我的类名和jar名。我将这些jar文件保存在WEB-Inf / lib文件夹下。

如果我在我项目的web文件夹下的jsp中使用这个applet标签工作正常,但是如果我在web / com中使用这个applet标签/在jsp中读取那么这不起作用。

请指导我可能出现的问题以及可以做些什么?

0 个答案:

没有答案