java - class not found exception and IO exception while run applet on web -
this jsp file body tag.
<body> <jsp:plugin type="applet" code="sapplet.class" codebase="c:\program files\apache-tomcat-6.0.18\webapps\testweb\web-inf\classes" width="400" height="300" jreversion="1.6"></jsp:plugin> </body>
i want run applet on web application, got following error fetch on 1 small window.i can't error on console.
java plug-in 1.6.0_20 using jre version 1.6.0_20-b02 java hotspot(tm) client vm user home directory = c:\documents , settings\sandy ---------------------------------------------------- c: clear console window f: finalize objects on finalization queue g: garbage collect h: display message l: dump classloader list m: print memory usage o: trigger logging q: hide console r: reload policy configuration s: dump system , deployment properties t: dump thread list v: dump thread stack x: clear classloader cache 0-5: set trace level <n> ---------------------------------------------------- load: class sapplet.class not found. java.lang.classnotfoundexception: sapplet.class @ sun.plugin2.applet.applet2classloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.plugin2.applet.plugin2classloader.loadcode(unknown source) @ sun.plugin2.applet.plugin2manager.createapplet(unknown source) @ sun.plugin2.applet.plugin2manager$appletexecutionrunnable.run(unknown source) @ java.lang.thread.run(unknown source) caused by: java.io.ioexception: open http connection failed:http://localhost:8080/testweb/sapplet/class.class @ sun.plugin2.applet.applet2classloader.getbytes(unknown source) @ sun.plugin2.applet.applet2classloader.access$000(unknown source) @ sun.plugin2.applet.applet2classloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) ... 7 more exception: java.lang.classnotfoundexception: sapplet.class load: class sapplet.class not found. java.lang.classnotfoundexception: sapplet.class @ sun.plugin2.applet.applet2classloader.findclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ java.lang.classloader.loadclass(unknown source) @ sun.plugin2.applet.plugin2classloader.loadcode(unknown source) @ sun.plugin2.applet.plugin2manager.createapplet(unknown source) @ sun.plugin2.applet.plugin2manager$appletexecutionrunnable.run(unknown source) @ java.lang.thread.run(unknown source) caused by: java.io.ioexception: open http connection failed:http://localhost:8080/testweb/sapplet/class.class @ sun.plugin2.applet.applet2classloader.getbytes(unknown source) @ sun.plugin2.applet.applet2classloader.access$000(unknown source) @ sun.plugin2.applet.applet2classloader$1.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) ... 7 more exception: java.lang.classnotfoundexception: sapplet.class
your code base written wrong. should relative web path.
in case should testweb/applet-classes. put applet classes there, not under web-inf. web-inf place should store classes run on server side. folder may not accessible web. applet classes downloaded jvm running browser, web-inf may not visible it.
better way pack applet classes jar file , put under root of application. in case code base codebase='myapplet.jar'
Comments
Post a Comment