Results 1 to 5 of 5
  1. #1
    Oviya is offline Member
    Join Date
    Aug 2014
    Posts
    2
    Rep Power
    0

    Default 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 Advance
    Last edited by Oviya; 08-19-2014 at 02:44 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,964
    Rep Power
    31

    Default 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.

  3. #3
    Oviya is offline Member
    Join Date
    Aug 2014
    Posts
    2
    Rep Power
    0

    Default Re: Applet Help -Class not found error

    Thanks to your Reply Norm. I have tried to way by copying Jar file within HTML folder but still i am getting the error .
    I have attached error screen shot and Folder structure.

    Applet Help -Class not found error-applet-error.jpgApplet Help -Class not found error-folder-structure.jpg
    Attached Thumbnails Attached Thumbnails Applet Help -Class not found error-applet-error.jpg  
    Last edited by Oviya; 08-20-2014 at 01:50 PM.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,964
    Rep Power
    31

    Default 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.

  5. #5
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    878
    Rep Power
    11

    Default 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

  1. Replies: 8
    Last Post: 11-22-2012, 07:16 AM
  2. main method not found error in class . wat s the error?
    By kirankumaragnihotram in forum New To Java
    Replies: 10
    Last Post: 06-29-2012, 11:26 AM
  3. Replies: 0
    Last Post: 02-02-2012, 07:24 AM
  4. . class not found when trying to run applet?
    By louiedogg418 in forum New To Java
    Replies: 3
    Last Post: 08-04-2011, 06:43 PM
  5. No Class Def Found Error:
    By fithous in forum Java Applets
    Replies: 0
    Last Post: 04-02-2009, 05:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •