Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2011
    Location
    Belgium
    Posts
    25
    Rep Power
    0

    Default magical error ClassFormatError with Applet

    Hey I created a Java web project,

    It has a servlet and the servlet calls a jsp page.
    On this jsp page I call an applet, but when I run it in my browser the applet gives a magical error some number (ClassFormatError).

    No I am only learning, so I created a new project with an empty applet thats runnable.
    I copied the class file from that project and put in a directory where I could access it from my jsp page. (I also shanged the package to the correct one).

    What am i doing wrong, I only wan't to see an empty applet in my browser for learning purposes.

    Java Code:
    import java.applet.Applet;
    
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    public class AppletTest extends Applet{
        
        public void init(){
            System.out.println("test");
        }
    }
    Java Code:
     <jsp:plugin type="applet" code="JavaApplet.class" codebase="./Applets"
      width="800" height="600">
      <jsp:fallback>
       <p>Unable to load applet</p>
       </jsp:fallback>
    </jsp:plugin>

  2. #2
    Join Date
    Dec 2011
    Location
    Belgium
    Posts
    25
    Rep Power
    0

    Default Re: magical error ClassFormatError with Applet

    I fixed this, I just created a folder called classes under the webstructure and put the classes there,

    this code works for me now:

    Java Code:
    <jsp:plugin type="applet" code="basketball_coaching.GUI" codebase="./Classes"
      width="800" height="600">
      <jsp:fallback>
       <p>Unable to load applet</p>
       </jsp:fallback>
    I have an other question because the applet loads but the data doesn't but I'll post it in an other topic, so this problem is solved.

Similar Threads

  1. Replies: 1
    Last Post: 07-23-2010, 03:42 PM
  2. ClassFormatError: LVTT
    By aslamk86 in forum Advanced Java
    Replies: 0
    Last Post: 03-10-2010, 03:40 PM
  3. Replies: 0
    Last Post: 09-14-2008, 04:47 PM
  4. Applet Error - Can't see console
    By eZs3 in forum Java Applets
    Replies: 3
    Last Post: 05-21-2008, 10:54 PM
  5. applet error
    By Peter in forum Advanced Java
    Replies: 2
    Last Post: 07-04-2007, 08:04 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
  •