4 Replies Latest reply on Jan 25, 2008 3:24 PM by Tony Huynh

    Loading Applets

    Tony Huynh Newbie

      Hi, I'm rather new at this....and am currently taking steps in learning how to use JBoss, anyway my question is...

      I'm trying to place an applet program within an existing JBoss server application. To do so I placed the applet class files (and JAR on subsuquent tests) into existing folders within the application,

      namely localhost/program/images/, the class file (lets call it app.class) is within this folder, however I am having trouble getting the applet to run.

      Instead I get an error that reads:

      ClassFormatException: Incompatible Magic Number 1008807213

      Which I belive means that the class file being provide is not legit.
      1008807213 translates to: "<!--", so it appears that I'm getting some xml/html instead.

      I was wondering if anyone knew where I should start to add this applet to an existing project?

        • 1. Re: Loading Applets
          jaikiran pai Master

          Google search for this error, led me to this http://forum.java.sun.com/thread.jspa?threadID=640927. See if it's applicable in your case too. Does the java console show any other exceptions?

          • 2. Re: Loading Applets
            Tony Huynh Newbie

            I've come across that thread during my quest to correct the problem, but it doesn't seem to provide a concrete answer...

            Just in case I'll elaborate on my problem...

            The applet (which runs fine through applet viewer/browers from local drives and off the net) is packaged into the war archive file.

            Upon opening the war file, the applet class file is there: cews.war/applet.class

            Going to localhost/cewslite/applet.class lets me download the class file no problem.

            But any applet tag that attempts to access the file gives me the error seen above.

            oh and thanks for the replay jaikiran, I appreciate the help

            • 3. Re: Loading Applets
              Tony Huynh Newbie

              Doesn't appear to be an 'edit post' option... oh well

              I suppose the main problem here is when I use an applet tag (from anywhere) to access the class files

              <applet code=app.class codebase="http://localhost/cews/" \>

              or an html in the same dir

              <applet code=app.class codebase="." />

              all of them fail with the magic number problem, which I assume is because instead of a class file some sort of html/xml (404 page?) file is retrieved and the applet viewer treats this as a class file instead.

              How am I to actually get to those class files when my server refuses to even try?

              Oh and I moved the class/jars from the image folder up one level to the root: http://localhost/cewslite/

              Argh

              • 4. Re: Loading Applets
                Tony Huynh Newbie

                :)

                Managed to figure it out.
                Turns out that in order to access any files within the file system in the application, you need to login. But because the applet loader retrieves the file in a different session I receive the login page.

                of which the first few characters are "<!--"

                now that I know whats wrong, I can make some progress!