Results 1 to 3 of 3
  1. #1
    dan0 is offline Member
    Join Date
    Feb 2009
    Posts
    40
    Rep Power
    0

    Question [SOLVED] ClassNotFoundException Error

    When I try to run my applet in a Firefox or IE browser I get the error below, anyone know how to resolve this?

    load: class TestAppletGUI not found.
    java.lang.ClassNotFoundException: TestAppletGUI
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed: server_address/TestAppletGUI.class
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unk nown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(U nknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknow n Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 7 more
    Exception: java.lang.ClassNotFoundException: TestAppletGUI
    There are two classes TestAppletGUI and AppletGUI, which are in a named package - projects.web - both of these classes are archived in UserInterface.jar

    In my web-page I use an applet tag:

    Java Code:
    <applet code="TestAppletGUI" archive="UserInterface.jar" width="500" height="500">
    </applet>

  2. #2
    dan0 is offline Member
    Join Date
    Feb 2009
    Posts
    40
    Rep Power
    0

    Default [resolved]

    I got the applet to run by:
    1. Changing the code reference to: projects.web.TestAppletGUI (the FQCN)
    2. re-archiving the class files


    To create the jar file I used the following cmd:
    Java Code:
    jar cvf UserInterface.jar projects\web\AppletGUI.class projects\web\TestAppletGUI.class
    Last edited by dan0; 03-03-2009 at 06:42 PM.

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default

    Congrats on solving this yourself, and many thanks for posting your solution for others to learn from. It's uncommon to see this.

Similar Threads

  1. ClassNotFoundException with Applet and new JRE
    By marrra in forum Java Applets
    Replies: 3
    Last Post: 06-22-2010, 12:13 PM
  2. ClassNotFoundException: org.sqlite.JDBC
    By JohnnyR in forum AWT / Swing
    Replies: 4
    Last Post: 02-25-2009, 07:30 AM
  3. ClassNotFoundException
    By Chezelle in forum Java Applets
    Replies: 5
    Last Post: 12-24-2008, 05:26 PM
  4. Replies: 0
    Last Post: 07-09-2008, 01:36 PM
  5. java.lang.ClassNotFoundException
    By ravian in forum New To Java
    Replies: 1
    Last Post: 01-07-2008, 11:31 AM

Posting Permissions

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