Results 1 to 5 of 5
- 08-19-2014, 03:38 PM #1
Member
- Join Date
- Aug 2014
- Posts
- 2
- Rep Power
- 0
Applet Help -Class not found error
HI All
iam using applet tag in html file
ex: <APPLET name="TreeMenuFrom"
code="com.scand.jtree.TreeApplet.class"
width="300"
height="250"
ARCHIEVE="/applets/jtree_eval.jar"
codebase="/"
MAYSCRIPT>
<PARAM NAME="root_closeable" VALUE="">
<PARAM NAME="menu" VALUE="treeMenuFrom">
<PARAM NAME="image0" VALUE="http://www.java-forums.org/images/item_open.gif">
<PARAM NAME="image1" VALUE="http://www.java-forums.org/images/item_node.gif">
<PARAM NAME="image2" VALUE="http://www.java-forums.org/images/item_open.gif">
<PARAM NAME="image3" VALUE="http://www.java-forums.org/images/item_closed.gif">
</applet>
TreeApplet.class is exist under com/scand/jtree but iam getting following error while loading the applet
my web application structure
myproject/WebContent/Applet/com/scand/jtree/TreeApplet.class
using xmlc DOM the a.html file will convert into aDOM.java, application is referrring to a.
please tell me how do i load applet sucessfully
Java Plug-in 10.5.1.255
Using JRE version 1.7.0_05-b06 Java HotSpot(TM) Client VM
User home directory = C:\Users\Oviya
----------------------------------------------------
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>
0-5: set trace level to <n>
load: class com.scand.jtree.TreeApplet.class not found.
java.lang.ClassNotFoundException: com.scand.jtree.TreeApplet.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
load: class com.scand.jtree.TreeApplet.class not found.
java.lang.ClassNotFoundException: com.scand.jtree.TreeApplet.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
Note : I dont think so if there any code changes required since with same calss and html file is working in production server in my project . But when i configure teh saem in my local machine i am getting this error and end with applet loading error .
Please help me out.
Thanks in AdvanceLast edited by Oviya; 08-19-2014 at 03:44 PM.
- 08-20-2014, 07:18 AM #2
Re: Applet Help -Class not found error
Try moving the jar file to the same folder with the html file so there is no path in the archive= tag.
What package is the class file in? Is the package path the same as the path to the class file in the jar file?If you don't understand my response, don't ignore it, ask a question.
- 08-20-2014, 02:45 PM #3
Member
- Join Date
- Aug 2014
- Posts
- 2
- Rep Power
- 0
- 08-20-2014, 05:48 PM #4
Re: Applet Help -Class not found error
I suggest copying the HTML and jar file out of the IDE folders to a separate folder for testing. The HTML's archive tag needs to be changed to point to the new location of the jar file.
Try testing first as local files without the server to check the connections.
I don't know how to configure the server.If you don't understand my response, don't ignore it, ask a question.
- 08-21-2014, 12:01 PM #5
Re: Applet Help -Class not found error
pls refer this section and verify ur structure.
1.1 Changes: Java Archive (JAR) Files and Applets
ARCHIVE = JARFile1, JARFile2, ...
This optional attribute specifies one or more Java archive (JAR) files associated with the applet. The archive files should be in the same directory the applet's class files would be. To specify that the archive file isn't in the same directory as the document containing the <APPLET> tag, specify the CODEBASE attribute.
Whenever a browser needs to load a file needed by an applet, the browser looks in the applet's JAR files first. If it doesn't find the file in the first JAR file specified with ARCHIVE, it looks any other specified JAR files, in the order they were specified. If the browser fails to find the file in a JAR file, then it looks in the applet's base directory. [Do we really guarantee that the JAR file specification order is the order in which the browser will look?]
Here's an example of creating and specifying a JAR file. Assume you have an applet that consists of two class files and an image file. You can create a JAR file that contains all three files. For example, on Solaris using the JDK, you might use this command:
jar cvf MyApplet.jar AnAppletSubclass.class Helper.class aPic.gif
You could then specify the JAR file to the browser using this <APPLET> tag:
<APPLET
ARCHIVE = MyApplet.jar
CODE = AnAppletSubclass.class
WIDTH = 300
HEIGHT = 100
>
</APPLET>
Here's an example of a more complex <APPLET> tag that uses the ARCHIVE attribute:
<APPLET CODEBASE="example/"
ARCHIVE="AppletButton.jar, IntlWindow.jar, Media.jar"
CODE="AppletButton.class"
WIDTH=350 height=60
ALT="Your browser understands the applet tag but isn't displaying any
applet.">
<PARAM NAME="windowWidth" VALUE=500>
<PARAM NAME="windowHeight" VALUE=130>
Since you can't run the applet, here's a picture of it:
<br>
<IMG SRC="images/AroundTheWorld_trans.gif" WIDTH=316 HEIGHT=411>
</APPLET>Ramya:cool:
Similar Threads
-
Help me I get this error: Error: Main method not found in class Position
By lo2 in forum New To JavaReplies: 8Last Post: 11-22-2012, 08:16 AM -
main method not found error in class . wat s the error?
By kirankumaragnihotram in forum New To JavaReplies: 10Last Post: 06-29-2012, 12:26 PM -
Applet error "Fish.class not found" while running through Chrome.
By DaveAp7 in forum New To JavaReplies: 0Last Post: 02-02-2012, 08:24 AM -
. class not found when trying to run applet?
By louiedogg418 in forum New To JavaReplies: 3Last Post: 08-04-2011, 07:43 PM -
No Class Def Found Error:
By fithous in forum Java AppletsReplies: 0Last Post: 04-02-2009, 06:30 PM
Bookmarks