2 Replies Latest reply on Apr 8, 2002 2:07 PM by 807593

    Applet Exception !

    807593
      My applet is a part of the Client-Server system. When my applet is called in browser this error apear:

      ----
      # Applet exception: error: java.lang.NoClassDefFoundError: javax/swing/JApplet
      java.lang.NoClassDefFoundError: javax/swing/JApplet
      at java.lang.ClassLoader.defineClass(Compiled Code)
      at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
      at netscape.applet.AppletClassLoader.findClass(Compiled Code)
      at netscape.applet.AppletClassLoader.loadClass1(Compiled Code)
      * at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
      at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
      at netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled Code)
      at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
      at java.awt.EventDispatchThread.run(Compiled Code)
      at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)
      ---------


      My CLASSPATH is :

      -----
      /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/local/java/jdk1.3.1_02/bin:/usr/local/java/jdk1.3.1_02/include:/usr/local/java/jdk1.3.1_02/src.jar:/home/furtado/anselmo/classes/server.jar:/var/www/htdocs/ambiente:.
      -----



      My application don't work too. It its error:


      --------
      root@furtado:/# java /home/furtado/anselmo/classes/TesteServer
      Exception in thread "main" java.lang.NoClassDefFoundError: /home/furtado/anselmo/classes/TesteServer (wrong name: TesteServer)
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
      -------


      Where is my error ?
      My classpath is correct ?
        • 1. Re: Applet Exception !
          807593
          Your classpath will not be used when you run your applet in a browser. It sounds like you are using the browsers internal jvm, which is usually a 1.1.x jvm, so it does not know anything about swing classes. That came with 1.2 and above.

          For your application, try this:
          java -classpath /home/furtado/anselmo/classes TesteServer
          • 2. Re: Applet Exception !
            807593
            Or better:
            java -classpath CLASSPATH:/home/furtado/anselmo/classes TesteServer
            or
            export CLASSPATH=CLASSPATH:/home/furtado/anselmo/classes/
            java TesteServer